Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have requirement to browse and upload the file. Here we put a fileupload control and to upload put one button, on button click the file should be uploaded.

Now the task is to upload the file automatically once browse the file without any button click events.

Please give me some inputs to do the same.

thanks
Posted

 
Share this answer
 
Comments
Shemeemsha (ഷെമീംഷ) 29-Oct-14 6:01am    
Good Answer
XML
Hi,

I have solved this myself, modified the code as below

 $(document).on('change', '#<%= FileUpload1.ClientID %>', function () {
                $('#<%= btnUpload.ClientID %>').click(); });

More important thing here is we should not make the button control visible=false. keep width to very less asmuch as it cannot visible.

Thanks
Rehman
 
Share this answer
 
Comments
Shemeemsha (ഷെമീംഷ) 29-Oct-14 6:46am    
With out using that button you can upload the file using jquery . Just write code inside onChange function..
 
Share this answer
 
v2

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