how to show a PROGRESS BAR control when uploading a file

Posted by Sravanthi.seeta under ASP.NET on 11/12/2010 | Points: 10 | Views : 23632 | Status : [Member] | Replies : 3
when am uploading a file in my application i want to show a progress bar control to the user...
How to do that...




Responses

Posted by: Lalji_mer on: 11/12/2010 [Member] Bronze | Points: 25
Posted by: Madhuk on: 11/12/2010 [Member] Starter | Points: 25

Up
0
Down
<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<Triggers>
<asp:PostBackTrigger ControlID="btnUpload" />
</Triggers>
<ContentTemplate>
<asp:FileUpload ID="myFile" runat="server" />
<asp:Label ID="lblMsg" runat="server"></asp:Label>
<br />
<asp:Button ID="btnUpload" runat="server" Text="Upload"
OnClick="UploadFile" OnClientClick="javascript:showWait();"/>
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<asp:Label ID="lblWait" runat="server" BackColor="#507CD1"
Font-Bold="True" ForeColor="White"
Text="Please wait ... Uploading file"></asp:Label>
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>

Place below in head section of page
<script language="javascript" type="text/javascript">

function showWait()
{
if ($get('myFile').value.length > 0)
{
$get('UpdateProgress1').style.display = 'block';
}
}
</script>


Sravanthi.seeta, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dora743 on: 11/15/2010 [Member] Starter | Points: 25

Up
0
Down
The best one

http://www.codeproject.com/KB/webforms/FileUploadWithProgrss.aspx

Dorababu

Sravanthi.seeta, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response