Hasfile property of FileUpload is always false in GridView
I am using FileUpload in GridView and this GridView is in UPdatePanel. This FileUpload is in footer of the GridView. I am uploading selected file in this FileUploader on a link button in same GridView. BUT when on uploading HasFile property is false.
I have google for this problem and on开发者_开发问答ly solution is to put button in
<asp:PostBackTrigger ControlID="Button1" />
But my FileUPloader is in GridView.
Any help, Thanks.
One option available to you as a workaround is to use the Ajax Upload jQuery plugin. An example on that page describes how to access the uploaded file in asp.net. Search for "IHttpHandler"
The FileUpload control relies on a normal <input type="file" />
html element, and that doesn't do anything until you submit the html form element... meaning you need a full postback rather than ajax update to see the file.
精彩评论