Click here to Skip to main content
15,908,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i use fileupload control in asp.net after each post back i should upload the file again and the filename property won't stay.
what can i do with this problem.
Posted
Updated 17-Jul-12 23:53pm
v2

1 solution

SQL
Due to some security reason FileUpload control will not keep the value during postback. It works in the same way as password field. So keep the fileupload control out of the update panel first and also dont expect the file path selected will keep during post back. As a work around what you can do is save the file path selected in a viewstate or session or hidden field to use it later.
 
Share this answer
 
Comments
Pooyan Behroozfar 18-Jul-12 6:30am    
thanks for helping my friend. but for what security reasons?

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