Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
2.00/5 (4 votes)
See more:
XML
<script type="text/javascript">
                    function FindAndClick() {
                        var FileUpload = document.getElementById("FileUpload1");
                        FileUpload.click();
                    }
  </script>
  <input type="button" value="Upload" onClick="FindAndClick()"/>
  <asp:FileUpload ID="FileUpload1" runat="server" Height="0px" Width="0px"/>





i m using this code.
using this code i able to call open dialog in button click but now .
how i get image name which i am selected............


plese help me....
thnx in advance
Posted
Comments
Albin Abel 9-Mar-11 23:41pm    
Why you are using a separate button. The file upload has its own button. Isn't it?
dilip.aim11 9-Mar-11 23:48pm    
but it also has its own text box... and i don,t want to show it...

1 solution

Dear Dilip,

Please use the following javascript

 <script language="javascript" type="text/javascript">
// <!CDATA[
        function Browse() {
            document.form1.FileUpload1.click();           
        }      
// ]]>
    </script>



Regards!
Aman
 
Share this answer
 
v3
Comments
dilip.aim11 9-Mar-11 23:49pm    
i know it...
bt i don,t want text box...
which come along with button..
Aman4.net 10-Mar-11 0:39am    
Answer is updated
Aman4.net 11-Mar-11 0:40am    
Please mark it as answer if it helped or Comment on it!
dilip.aim11 12-Mar-11 4:13am    
ok it show the dialog box
when i select the image it must be show in image box

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900