Show Updates on Progress RRS feed

  • Question

  • User-1170096362 posted


    I would like to show more information in my UpdatePanel. Instead of showing a simple "Please wait..." message, I would like to show which step it is currently at. Please refer to the sample code below.

    I cannot seem to increment the step on the Tick event of the Timer control.

    What is wrong?


    <%@ Page Language="C#" AutoEventWireup="true" %>

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Test Timer</title>

        <script runat="server">

            private int stepNumber;

            protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) stepNumber = 1; }

            protected void Timer1_Tick(object sender, EventArgs e)
                switch (stepNumber)
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                        TextBox1.Text = "At step " + stepNumber.ToString();
                        System.Threading.Thread.Sleep(stepNumber * 1000);
                        Timer1.Enabled = false;
                TextBox1.Text = "Timer Tick " + stepNumber.ToString();

        <form id="form1" runat="server">
                <asp:ScriptManager ID="Scriptmanager1" runat="server"></asp:ScriptManager>

                <asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick"></asp:Timer>

                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                        <%=DateTime.Now.ToString() %>

                <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0">


    Tuesday, February 4, 2014 7:16 PM


All replies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 4, 2014 10:52 PM
  • User1777983149 posted

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

    <div style="text-align: center;">
    <asp:UpdateProgress ID="UpdateProgress12" runat="server" AssociatedUpdatePanelID="UpdatePanel3"
    <div class="loaderOverlay1">
    <img src="images/loader.gif" alt="" />


    </asp:UpdatePanel >

    Wednesday, February 5, 2014 2:18 AM
  • User-1170096362 posted

    Thank you, Chetan. That's what I needed!

    Thursday, February 6, 2014 4:55 PM