Visual Studio .NET - How to retain Viewstate value for a Fileupload control

Asked By santhosh kumar on 01-Sep-14 10:50 AM
I am using FileUpload control in ASP.NET 2.0 ,I am having soome server side validation like whether the Filename already exists in the Folder.  When this condition goes wrong and returning to the page my TextBox Text in FileUpload control Gets Clearer, I made EnableViewstate property true, but no use, is there any other way?

u cant maintain that for fileupload control, but u can do one thing - K Pravin Kumar Reddy replied to santhosh kumar on 01-Sep-14 10:51 AM

You can't maintain that for fileupload control, but you can do one thing. When the user selects file to upload just save/show that file path using lable during postback lable will maintain data.

Thanks How to get the Full path in codebehind - santhosh kumar replied to K Pravin Kumar Reddy on 22-Mar-07 03:51 AM

end of post

you mean like this? - Burak Gunay replied to santhosh kumar on 22-Mar-07 08:02 AM

Dim file As String = String.Empty

file = Server.MapPath("courses.xml")

this will return you the fullpath of a file on your server