I have a detailsView inside the update panel., and in the detailsView I have a FileUpload Control and a button btn_Upload. In the click event I have written code :
if(fileUploadControl.HasFile)
{
var fileName = fileUploadControl.FileName;
}
Always returns false, can some one tell me why?
FileUpload inside UpdatePanel will cause a submit , however it will not work for security reasons – no browser will allow javascript to access random files in our filesystem. I suggest you use this http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx instead to do what you have in mind.
Another person who has worked around this issue blogs about it here.