Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Facing issue with FileUpload Control in WebDialogWindow in updatepanel
posted

Hi,

I would appreciate it a lot if someone could please help me with this. 

I have an updatepanel which has a button, which when clicked shows the web dialog window, and within that dialog window I have a file upload control and a button upload to save that file.  FileControl.HasFile is always returning false. What way can I work around this?  I have tried using the <Triggers><asp:PostBackTrigger ControlID="" /></Triggers> of the update panel but get an error that it can't find the control. 

I tried registering the PostBackTrigger through code below. It does not give any error but still the HasFile Property return false.

ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
if (scriptManager == null)
{
scriptManager.RegisterPostBackControl(this.btnUpload);

}

What is the way to use FileUpload control inside a WebDialogWindow. ? Any help would be really appreciated.

Thanks ,

Kimsi

Parents
  • 1660
    Offline posted

    Hello Kimsi,

    After some investigation, I have found that this issue isn’t related to the WebDialogWindow, in fact it is related to the UpdatePanel, this could be verified if you move the FileUpload from the WebDialogWindow to the UpdatePanel and the result would be the same.

    What I can suggest you is reviewing the following blog in the knowledgebase, which provides explanation of how to fix this with encoding the form with "multipart/form-data". You may also find this stackoverflow post helpful, since it provides few different solutions to this issue.

    Please let me know if you have any questions.

    Regards,
    Ivan Kitanov

Reply Children