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
What role “#&&” plays in a querysting?
Why mvc is better than asp.net? : Asp.Net MVC
Can we use html in asp.net?
Where you store Connection string in "Web.Config" file in ASP.NET?
How does a content page differ from a master page?
what is silver light when will we use silver light,
What is state management in asp.net with example?
Define common type system?
Explain About duration in caching technique
What is a postback ispostback and autopostback in asp net?
What are the features that make asp.net more used framework? : asp.net mvc
Who is using asp.net?
How can we create Tree control in asp.net?
What is a viewbag?
What is difference between ispostback and autopostback in asp net?