Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
update panel problem with file upload.but file upload out of update panel. file upload has file is always false.
Posted
Comments
phil.o 9-Sep-13 3:40am    
Unclear and incomplete ; please give some more details and code because we cannot guess your actual issue.
Dholakiya Ankit 9-Sep-13 6:37am    
give us code to see

It is because of Form's encType attribute.
you need to set
encType = "multipart/form-data"


Try this code inside Init evet of your control. It will add the encType attribute to the form you have on your page and then you may receive file bytes inside FileUpload Control.

C#
ScriptManager.RegisterStartupScript(page, page.GetType(), Guid.NewGuid().ToString() + new Random().ToString().Replace(".", ""), "$('#yourFormID').attr('enctype', 'multipart/form-data');", true);


Note: you need to have JQuery referenced onto your page or alternatively use javascript to do this job.

Good luck :)
 
Share this answer
 
v2
I have Same Problem

File Upload Is not Working In UpdatePanel.........
 
Share this answer
 
Comments
Zubair Alie 10-Sep-13 2:31am    
View the Solution # 3 for using FileUpload in UpdatePanel.

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