varunmaggo's say

Getting better never stops!

Archive for January 2012

async upload control in update panel (asp.net web forms)

leave a comment »

There is an issue with upload controls when used with update panels. Moreover they are not just supported.

The quick fix is:

Put this in your page load  Page.Form.Attributes.Add(“enctype”, “multipart/form-data”);

Put a trigger to your update panel : <Triggers>
                <asp:PostBackTrigger ControlID=”btnSubmit” />
            </Triggers>

Put your upload control : <asp:AsyncFileUpload ID=”fuImage” runat=”server” UploaderStyle=”Modern” Style=”margin-left: 100px;”
                                                onchange=”return ImageValidate()” />

 

Thanks

Written by Varun Maggo

January 31, 2012 at 9:50 am

Posted in Uncategorized

Tagged with , ,

Follow

Get every new post delivered to your Inbox.