Wednesday, 6 June 2012

ASP.NET Ajax Extension - Timer control

Paste Into ASPX Source
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="timer.aspx.cs" Inherits="timer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head id="Head1" runat="server">
<title>ASP.NET EXAMPLES | Ajax Extensions | Ajax Examples | Ajax Timer control </title>
<body style="font-family:Tahoma; font-size:14px;">
<form id="form1" runat="server">
<div style="border: 2px; font-size: 12px; border-color: Black; border-style: solid;
color: White; background-color: Red; font-weight: bold; font-family: Tahoma">
By : <a href="" style="color: Yellow" target="_search">
asp-examples</a> (Click to get more Examples)
<br />
Author : Akash Parmar<br />
Company Name : Soft-Tech Designs n Development<br />
We Design your Dreams - Develop your Life...
<%--Its required to place ScriptManager within the form tag whenever you use any Ajax Controls...--%>
<asp:ScriptManager ID="ScriptManager1" runat="server">
ASP.NET Ajax Timer control...</h4>
Countdown Timer using Ajax Timer Control...
<div style="border: 2px; height:100px;  border-color: Black; border-style: solid">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<asp:Label ID="Label1" runat="server" Text="10" Font-Size="50pt" 
Font-Bold="True" ForeColor="#FF3300"></asp:Label>
<asp:Label ID="Label2" runat="server" Font-Size="30pt" 
Text="seconds remaining...."></asp:Label>
<asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
<br />
<asp:Label ID="Label3" runat="server" Font-Size="20pt" Font-Bold="True" 

Paste Into ASPX.CS Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class timer : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
protected void Timer1_Tick(object sender, EventArgs e)
if (Convert.ToInt32(Label1.Text) > 1)
Label1.Text = Convert.ToString(Convert.ToInt32(Label1.Text) - 1);
Timer1.Enabled = false;
Label3.Text = "Time Up..!";
Label1.Visible = false;
Label2.Visible = false;


Anonymous said...

Nice Code

aparna john said...

Hi,An efficient stylish Web Design Cochin tells your business sales story in an easy, straightforward manner. But do not get me incorrect: there is absolutely nothing incorrect with forging ahead of Website design.Thanks.........

arpita singh said...

really a great informative blog..
Learn Free ASP .NET

Albert Andrada said...

Really Nice Information,Thank You Very Much For Sharing.
Web Development Company

mounika r said...

It'sVery informative blog and useful article thank you for sharing with us , keep posting learn

more about Dot net
Dot NET Online Training

Post a Comment

Ranking Website Directory | seo tool | Manoli | ASPDOTNETGUIDE