views:

611

answers:

2

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 only solution is to put button in

<asp:PostBackTrigger ControlID="Button1" />

But my FileUPloader is in GridView.

Any help, Thanks.

A: 

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.

Joel Coehoorn
A: 

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"

Joel Harris