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 are the built-in objects in asp.net?
What is web router?
Explain client-side scripting?
Write some code using interfaces, virtual methods, and an abstract class`
How can we prevent browser from caching an aspx page?
How to deploy/publish webservices?How many ways?Plz explain me
what is meant by sitemapnode ?
What is a swagger in web api?
What is a query string in a url?
What are the disadvantages of asp.net?
Mention few asp.net validators.
How do I send an email message from my ASP.NET page?
What is the difference between session and viewstate in asp.net?
What is special types forms
Explain the different types of directives in .net?