Loading ...

File upload control always null when i used update panel

Who is online?  0 guests and 0 members
home  »  forums   »  basic asp.net   »  web forms   » File upload control always null when i used update panel

File upload control always null when i used update panel

Posts under the topic: File upload control always null when i used update panel

Posted: 2/26/2009

Contributor 2255  points  Contributor
  • Joined on: 11/30/2008
  • Posts: 11
  Answered

Hello!!

When i am uploading a file by file upload control it gives always hashfile false.

my file upload control and upload button enclosed in update panel.

when i remove update panel it works correctly.

 

 


Posted: 2/26/2009

Contributor 4863  points  Contributor
  • Joined on: 11/27/2008
  • Posts: 79
  Answered

Posted: 11/11/2009

Starter 710  points  Starter
  • Joined on: 11/11/2009
  • Posts: 34
  Answered

Hi,

The FileUpload control is designed to be used only in postback scenarios and not in asynchronous postback scenarios during partial-page rendering. When you use a FileUpload control inside an UpdatePanel control, the file must be uploaded by using a control that is a PostBackTrigger object for the panel. Despite of this there are several solutions that implement ajax update panel.

http://en.fileuploadajax.subgurim.net/

http://aspalliance.com/1442_Building_AJAX_Enabled_File_Uploading_System_with_Progress_Bar_Using_ASPNET_20

http://www.codeproject.com/KB/aspnet/AJAXUpload.aspx

Good luck

 


Posted: 5/18/2010

Professional 8505  points  Professional
  • Joined on: 5/3/2010
  • Posts: 391
  Answered

Another suggesstion would be

Add the FileUpload1 to Session like

Session["myFileUpload"] = FileUpload1

then get it back in any page you want to:

FileUpload flUp = Session["myFileUpload"] as FileUpload


Page 1 of 1 (4 items)