0% found this document useful (0 votes)
38 views

File Upload in Update Panel

This document contains ASP.NET code for a file upload form with an UpdatePanel and UpdateProgress component. The form includes a FileUpload control, Upload button, and loading image displayed by the UpdateProgress during the upload process. Clicking the button triggers a postback and displays the loading image.

Uploaded by

ravi3184
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

File Upload in Update Panel

This document contains ASP.NET code for a file upload form with an UpdatePanel and UpdateProgress component. The form includes a FileUpload control, Upload button, and loading image displayed by the UpdateProgress during the upload process. Clicking the button triggers a postback and displays the loading image.

Uploaded by

ravi3184
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="true" CodeFile="frmfileupload.aspx.

cs" Inherits="frmfileupload" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <script language="javascript" type="text/javascript"> function showWait() { if ($get('ctl00_ContentPlaceHolder1_FileUpload1').value.length > 0) { $get('ctl00_ContentPlaceHolder1_up1').style.display = 'block'; } } </script> <asp:UpdatePanel ID="u1" runat="server"> <Triggers> <%--<asp:AsyncPostBackTrigger ControlID="btnupload" EventName="Click" />--%> <asp:PostBackTrigger ControlID="btnupload" /> </Triggers> <ContentTemplate> <table class="style1"> <tr> <td style="width: 128px"> &nbsp; </td> <td style="width: 174px"> <asp:FileUpload ID="FileUpload1" runat="server" /> </td> <td> <asp:UpdateProgress AssociatedUpdatePanelID="u1" ID="up1" runat="server"> <ProgressTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/ajax-loader.gif" /> </ProgressTemplate> </asp:UpdateProgress> </td> </tr> <tr> <td style="width: 128px"> &nbsp; </td> <td colspan="2"> <asp:Button ID="btnupload" runat="server" Text="Upload" OnClick="btnupload_Click" OnClientClick="javascript:showWait();" /> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> </asp:Content>

You might also like