infolink

Thursday, February 25, 2010

ASP.NET FileUpload Web Control Issue in DotNetNuke

Today I uploaded a form which included an ASP.NET File Upload Control. At first glance it looked like everything was fine. It turns out, no matter what I did the controls hasfile property was false.

After some searching I came accross this on MSDN:

Note:
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. UpdatePanel controls are used to update selected regions of a page instead of updating the whole page with a postback. For more information, see UpdatePanel Control Overview and Partial-Page Rendering Overview.


Well hmm, this is in dotnetnuke and in it's settings page which I know is an update panel this has to be my issue. So as a workaround and instead of using a PostBackTrigger, I decided to use the build in dnn upload control located in root/admin/files/webupload.asx.

No comments:

Post a Comment

Amazon1