About the author

Vijay Kodali
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

AsyncFileUpload events with Update Panel

Problem:

 

Last week I came across this bug (?) with AsyncFileUpload control in updatepanel. The control is not firing OnUploadedComplete server side event when it’s in updatepanel.

 

Solution:

 

After doing some research on this issue, came across these solutions.

 

1)     Add another AsyncFileUpload control on the page and set its’ style to display:none; 

 

       

<div style="display: none;">

  <cc1:AsyncFileUpload ID="AsyncFileUpload1" runat="server" />

</div>

 

 

2)     Another workaround is to add the following attributes to the <form> tag of the page..

enctype="multipart/form-data" method="post"

 

 

Both the solutions are working fine.

 

 

Thanks to obout_teo and MikeMelendez of Asp.Net forums


Categories: AJAX | ASP.Net 3.5
Posted by Vijay on Monday, September 20, 2010 6:22 PM
Permalink | Comments (5) | Post RSSRSS comment feed

Comments

james Mílahaŋska Tȟamákȟočhe

Sunday, April 3, 2011 2:06 PM

james

very nice thanks

V.R.Hari རྒྱ་གར་

Wednesday, November 9, 2011 5:12 AM

V.R.Hari

I am sorry, none of the above tricks working for me.  I am using VS 2008 with DN FW 3.5. Any solutions ??
thanks.

V.R.Hari རྒྱ་གར་

Wednesday, November 9, 2011 5:14 AM

V.R.Hari

I am sorry, none of the above tricks working for me.  I am using VS 2008 with DN FW 3.5. Any solutions ??
thanks.

Nattapong Thailand

Wednesday, December 19, 2012 1:50 AM

Nattapong

It works fine for me but i have to add a few line of code in codebehind.
In my project when i click button i display the asynfileupload by adding these

  Dim javastr As String = "document.getElementById('AsynFileupload_div').style.display = 'block';"
            ScriptManager.RegisterClientScriptBlock(Page, Me.GetType(), "display", javastr, True)
where AsynFileupload_div is the div tag that cover the <asp:AsyncFileUpload >.</asp:AsyncFileUpload > tag


<div id="afu_div"  style="display:none;">
                 <asp:AsyncFileUpload runat ="server" ID="afu_course"  
                 OnClientUploadComplete ="uploadComplete"
                 OnClientUploadError="showUploadError"/>
            </div>

Nattapong Thailand

Wednesday, December 19, 2012 1:51 AM

Nattapong

It works fine for me but i have to add a few line of code in codebehind.
In my project when i click button i display the asynfileupload by adding these

  Dim javastr As String = "document.getElementById('AsynFileupload_div').style.display = 'block';"
            ScriptManager.RegisterClientScriptBlock(Page, Me.GetType(), "display", javastr, True)
where AsynFileupload_div is the div tag that cover the <asp:AsyncFileUpload >.</asp:AsyncFileUpload > tag


<div id="afu_div"  style="display:none;">
                 <asp:AsyncFileUpload runat ="server" ID="afu_course"  
                 OnClientUploadComplete ="uploadComplete"
                 OnClientUploadError="showUploadError"/>
            </div>

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading