Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The best way to refresh my .aspx site with a Timer in C#?

Tags:

c#

asp.net

timer

I have a default.aspx page that needs to be refresh every 10 sec.

My solution so far is a javascript function, but it only works in Firefox and not IE.

I'm looking for a way to handle the refresh mecanism in the default.aspx.cs page instead, with some sort of Timer.

Any good simple sugestions/hints or solutions out there that can lead me in the right direction?

like image 724
radbyx Avatar asked Dec 04 '22 12:12

radbyx


1 Answers

Just use a <meta> tag in your page header to indicate automatic refresh:

<meta http-equiv="refresh" content="10" />

You should only use a JavaScript refresh approach if you need to pass some information (that may have changed) back to the page on the server.

like image 111
LBushkin Avatar answered Dec 06 '22 02:12

LBushkin