How to upload a file using file upload control inside the
Update Panel???

Answer Posted / manikanta

In source aspx page
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:AsyncFileUpload ID="AsyncFileUpload1"
runat="server" UploaderStyle="Modern" ThrobberID="img1" />
<br />
<asp:Button ID="btnUpload" runat="server" Text="Upload"
onclick="btnUpload_Click" />
in Aspx.cs
{

AsyncFileUpload1.SaveAs(Server.MapPath((AsyncFileUpload1.FileName)));
Label1.Text = "You uploaded " +
AsyncFileUpload1.FileName;
}


Try running this and you will find that the whole operation
happens asynchronously without a full page reload. Note
that, you would need to still put the AsyncFileUpload
control inside UpdatPanel for this behaviour. Otherwise, it
would behave like a regular postback control.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is break mode?

613


Explain the difference between inline and code behind - which is best in?

590


What is viewstate information stored?

706


What is the significance of finalize method in .net?

637


What are the different types of proxy patterns?

678






How do you design a website with multilingual support in ASP.NET ?

636


What is _dopostback in asp net?

603


Why does my asp.net file have multiple tag with runat=server?

655


What are the best practices to follow to secure connection strings in an ASP.NET web application?

646


Which object is used to encapsulate the state of the client and the browser in ASP.NET?

684


What’s the catch?

709


Explain the disadvantages of viewstate?

657


How to reduce the width of textbox in editcommandcolumn of datagrid?

616


What are the namespace classes used in asp.net mvc? : asp.net mvc

640


What are the properties of the eventargs argument when capturing keyboard events?

660