Blog

Asp.net file upload control using ajax(update panel)

Posted by Abhijit barua Blogs | Visual Studio 2010 Aug 23, 2012
Asp.net file upload control using ajax(update panel)
Today i want to show file upload control using ajax

here is .aspx 

 <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
     <Triggers>
        <asp:PostBackTrigger ControlID="Button1"/>
    </Triggers>
  <ContentTemplate>
    <asp:FileUpload ID="FileUpload1" runat="server" />
      <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    </ContentTemplate>
      </asp:UpdatePanel>

And at .cs page you can get like below.

 protected void Button1_Click(object sender, EventArgs e)
    {
        string a = FileUpload1.PostedFile.FileName;
    }
post comment
     
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts