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
How response object is related to asp's response object?
How is mvc different from asp.net? : Asp.Net MVC
How do u declare static variable and how it is declared and what is its lifetime?
What are the steps involved to fill a dataset?
What are the ways of preserving data on a Web Form in ASP.NET?
What are the different session state management options available in asp.net?
What is meant by web application?
What are the media types of http requests and response?
What is session object? Describe in detail.
What are the options in ASP.NET to maintain state?
Disable browser cache for entire ASP.NET website?
How can you enable impersonation in the web.config file?
Mention the execution process for managed code?
What is preprocessor in .net?
What are the difference between function and stored procedure in .net programming language?