Click here to Skip to main content
15,894,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Get Html input file (file browser) URL from javascript. Need help.
Posted

1 solution

You can store it by this way

C#
<asp:fileupload id="FileUpload1" runat="server" onchange="test(this);" xmlns:asp="#unknown" />
<asp:hiddenfield id="HiddenField1" runat="server" xmlns:asp="#unknown" />


XML
<script language="javascript" type="text/javascript">

       function test(Obj) {
           document.getElementById('<%=HiddenField1.ClientID %>').value = Obj.value;
           
       }
   </script>
 
Share this answer
 
Comments
rakib.cse.sust 1-Feb-12 6:53am    
I am trying it in MVC3. Not looking Asp.net.

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