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

benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks

1758


Explain the different parts that constitute ASP.NET application?

557


How is mvc different from asp.net? : Asp.Net MVC

538


What is application Object?

586


What is data reader in asp.net?

488






Why asp.net is used?

551


What is session state server?

608


What is the use of the tag in the web.config file?

562


How to implement role based security in asp.net mvc? : Asp.Net MVC

429


What is meant by ispostback in asp net?

535


How to turn off cookies for a page?

570


How to change Master page in ASP.Net using code?

586


How does viewstate work?

563


Explain the difference between asp.net mvc and asp.net webforms

561


What is difference between session and viewstate?

465