4
Contributors
7
Replies
11
Views
7 Years
Discussion Span
Last Post by finito
0

I found solution.
No need of JavaScript

.....................................................................................
DESIGN
.....................................................................................

<div>
	<asp:Timer runat="server" ID="Timer1" Interval="1000" OnTick="Timer1_Tick" Enabled="False" />
	<asp:UpdatePanel runat="server" ID="TimePanel" UpdateMode="Always">
	<Triggers>
		<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
	</Triggers>
	<ContentTemplate>
		<asp:Label ID="lblMinute" runat="server"></asp:Label>
		<asp:Label runat="server" ID="lblTimeSep" Text=" : " />
		<asp:Label runat="server" ID="lblSeconds"/>
	</ContentTemplate>
	</asp:UpdatePanel>
</div>

.....................................................................................
C# CODE
.....................................................................................

static int seconds = 59;
static int minute = 0; // maximum value as ur desire
protected void Timer1_Tick(object sender, EventArgs e)
{
	seconds--;
	if (seconds == 0)
        {
            seconds = 59;
            minute = minute + 1;
        }
        
        if (minute==30) 
        {
           Response.Redirect("ThankYou.aspx");  // event ot handle
        }
        lblMinute.Text = minute.ToString();
        lblSeconds.Text = seconds.ToString();
}

...................................................................................

Thank You.

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

0

I found solution.
No need of JavaScript

:D
Its called AJAX (Asynchronous JavaScript and XML).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.