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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Sceen and user selected intervals

Status
Not open for further replies.

JasonDBurke

Programmer
Jun 20, 2001
54
0
0
US
I'm writing an application in which log data is being displayed on the screen using (C#/ASP.NET). I'd like the user to beable to click on various radio buttons representing different time intervals to refresh the screen.

I've tried using the C# timer control but this isn't working so I'm moving over to JavaScript to handle this. Here is some pseudocode on what i'm attempting:

if(radioButton1.clicked)then
{
refreshpage = 5 seconds
}
else if(radioButton2.clicked)then
{
refreshpage = 10 seconds
}
else if(radioButton3.clicked)then
{
refreshpage = 30 seconds
}

Anyone know how to code this is Javascript?

Thanks,
Jason
 
Use Javascript (a function called as a result of the [tt]onclick[/tt] event of the checkbox) to drop a cookie on the user's machine specifying the delay in seconds.

Read the cookie value on document.onload into a variable X and use setTimeout("location.refresh()", X * 1000); to refresh the page in X,000 thousandths of a second.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top