Click here to Skip to main content
15,886,806 members
Articles / Web Development / ASP.NET

Web Form with Progress Bar of Web Service Execution

Rate me:
Please Sign up or sign in to vote.
2.00/5 (4 votes)
6 Aug 2008CPOL1 min read 44.1K   1K   28  
Show developers how to manage state of long running web service and then use this state in Ajax enabled web form
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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 id="Head1" runat="server">
    <title>Test Demo</title>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width: 873px; margin: 0 auto; margin-top:20px; BACKGROUND-IMAGE: url(Images/SubBG.jpg);	BACKGROUND-REPEAT: repeat-x;">    

        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

    <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="500" 
            Enabled="False">
    </asp:Timer>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="width: 100%">
                <tr>
                    <td style="width:120px; min-width:120px;">
                        <asp:Button ID="B_Start" runat="server" style="width:120px;" 
                            Text="Start process" onclick="B_Start_Click" />
                    </td>
                    <td style="width:600px; position:relative; float:left;">
                        
                        <div id="Div3" runat="server" style="border:thin;border-style:solid; width:200px;height:20px; float:left;">
                          <div id="Div1" runat="server" style="BACKGROUND-IMAGE: url(Images/SubBG2.jpg); width:0px; height:20px;">
	                          <asp:Label ID="L_P1" runat="server" Text="Step" style="text-align:center;" Width="200"></asp:Label>
                          </div>
                        </div>
                        <div id="Div4" runat="server" style="border:thin;border-style:solid; width:200px;height:20px; float:left">
                          <div id="Div2" runat="server" style="BACKGROUND-IMAGE: url(Images/SubBG2.jpg); width:0px; height:20px;">
	                          <asp:Label ID="L_P2" runat="server" Text="Value" style="text-align:center;" Width="200"></asp:Label>
                          </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width:120px; min-width:120px;">
                        <asp:Button ID="B_Stop" runat="server" style="width:120px;" Text="Stop process" 
                            onclick="B_Stop_Click" />
                    </td>
                    <td style="width:600px;">
                        <asp:Label ID="L_Status" runat="server" Text="Status"></asp:Label>
                    </td>
                </tr>
            </table>
        <asp:GridView ID="GridView1" runat="server"></asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
        </Triggers>
    </asp:UpdatePanel>
</body>        

</div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions