Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Modal popup extender

$
0
0

I've never used the popup extender and I'm not sure how to set it up.

I have a timer and that can start, stop, and reset. I want to have a popup after 10 consecutive seconds have passed (or however long I want), where it will stop the timer and say: Continue timer?

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><Triggers><asp:AsyncPostBackTrigger controlid="tm1" EventName="Tick"/></Triggers><ContentTemplate><asp:Timer ID="tm1" runat="server" Interval="1000" OnTick="tm1_Tick"></asp:Timer><div id="timer">&nbsp;&nbsp;&nbsp;<asp:Label ID="lblTimer" runat="server" Text="00 : 00" Font-Size="XX-Large" BackColor="#003399"></asp:Label><br /><br /><asp:Button ID="btnStart" runat="server" OnClick="btnStart_Click" Text="Start" /><br /><br /><asp:Button ID="btnReset" runat="server" OnClick="btnReset_Click" Text="Reset" /></div></ContentTemplate></asp:UpdatePanel>
    protected void tm1_Tick(object sender, EventArgs e)
    {
        long sec = sw.Elapsed.Seconds;
        long min = sw.Elapsed.Minutes;
        long hrs = sw.Elapsed.Hours;



            if (hrs < 10)
                lblTimer.Text = "0" + hrs;
            else
                lblTimer.Text = hrs.ToString();

            lblTimer.Text += " : ";

        
            if (min < 60)
            {
                if (min < 10)
                    lblTimer.Text = "0" + min;
                else
                    lblTimer.Text = min.ToString();

                lblTimer.Text += " : ";

                if (sec < 10)
                    lblTimer.Text += "0" + sec;
                else
                    lblTimer.Text += sec.ToString();
        }
        else
        {
            sw.Stop();
        }

    }





Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>