Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timer at ASP

Status
Not open for further replies.

neomax

Programmer
Jul 1, 2006
29
BG

does it possible to make timer on page.aspx, that is works on server side?
or it's possible only with client side - JavaScript??
 
The timer in asp.net runs on the server not the page.. so if you need client side timer functionality, you need javascript.

 
ok, does that code will be appropriate for server side??

private void StartTimer()
{
System.Timers.Timer myTimer = new System.Timers.Timer();
myTimer.Interval = 5000;
myTimer.Elapsed += new System.Timers.ElapsedEventHandler(myTimer_Elapsed);
myTimer.Enabled = true;
}

protected void myTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
//do some work
}
if, YES, how can the real time will display on the page?
 
hi, what exactly are you trying to do? why use timers at all???

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top