Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I run a client side progress bar and percentage value according to the work completed on the server?

I am using vb.net for this, My progressbar.aspx file look like:--

XML
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="EOProgressBar.aspx.vb" Inherits="EOProgressBar" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Progress Bar</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">

        <ContentTemplate>

            <eo:ProgressBar ID="ProgressBar1" runat="server" Width="250px" BorderColor="Black"
            BorderStyle="Solid" BorderWidth="1px" ControlSkinID="None" CssBlock="&lt;style type=&quot;text/css&quot;&gt;
&lt;/style&gt;" ShowPercentage="True" BackgroundImage="00060201"
                BackgroundImageLeft="00060202" BackgroundImageRight="00060203"
                IndicatorImage="00060204" IndicatorIncrement="8">

    </eo:ProgressBar>
    <asp:Timer ID="Timer1" runat="server" Interval="500">
    </asp:Timer>
        <asp:Label ID="Label1" runat="server" Text="0"></asp:Label>

        </ContentTemplate>
        </asp:UpdatePanel>


    </div>


    </form>

</body>

</html>




------------------------------------------------
my progressbar.aspx.vb is:--

VB
Partial Class EOProgressBar
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub

    Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        If Label1.Text < 101 Then
            Label1.Text = CStr(CInt(Label1.Text) + 1)
        Else
            Timer1.Enabled = False
        End If
        ProgressBar1.Value = Label1.Text
    End Sub
End Class


I am using update panel too.
I have used the timer to fill the value of progress bar, but inspite of that I have to write the code according to the process status running on the server.
How do I do this?
Any ideas, plese help me.
Thanks in advance.
Posted
Updated 18-Feb-11 0:38am
v3
Comments
Dalek Dave 7-Feb-11 4:42am    
Edited for Grammar and Readability.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900