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 is break mode?
Explain the difference between inline and code behind - which is best in?
What is viewstate information stored?
What is the significance of finalize method in .net?
What are the different types of proxy patterns?
How do you design a website with multilingual support in ASP.NET ?
What is _dopostback in asp net?
Why does my asp.net file have multiple tag with runat=server?
What are the best practices to follow to secure connection strings in an ASP.NET web application?
Which object is used to encapsulate the state of the client and the browser in ASP.NET?
What’s the catch?
Explain the disadvantages of viewstate?
How to reduce the width of textbox in editcommandcolumn of datagrid?
What are the namespace classes used in asp.net mvc? : asp.net mvc
What are the properties of the eventargs argument when capturing keyboard events?