468,168 Members | 1,447 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,168 developers. It's quick & easy.

auto reload of a page

I have an aspx page that needs to reload itself every x seconds. X is a
parameter retrieve from the DB or the web.config file, just to point out
that it will not be hardcoded.

I need to refresh the page as the information displayed on that page is
highly dynamic and need to be refresed very often.

Now I would like to know the best way to achieve this.

I have heard of using the <meta http-equi='refresh'> or then maybe use
javascrip.

But is there nto anything build in the ASP.NET framework?

Best regards,

Francois
Nov 18 '05 #1
3 1480

"francois" <fr******@bettinghouses.com_NOSPAM> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
I have an aspx page that needs to reload itself every x seconds. X is a
parameter retrieve from the DB or the web.config file, just to point out
that it will not be hardcoded.

I need to refresh the page as the information displayed on that page is
highly dynamic and need to be refresed very often.

Now I would like to know the best way to achieve this.

I have heard of using the <meta http-equi='refresh'> or then maybe use
javascrip.

But is there nto anything build in the ASP.NET framework?

Best regards,

Francois


not exactly built-in, but you could also use
Response.AddHeader("Refresh", refreshrate.ToString());

(where "refreshrate" is the refreshrate in seconds)

this is the "original version" of <meta http-equiv="refresh"
content="refreshrate">

Hans Kesting
Nov 18 '05 #2
francois wrote:
I have an aspx page that needs to reload itself every x seconds. X is a
parameter retrieve from the DB or the web.config file, just to point out
that it will not be hardcoded.

I need to refresh the page as the information displayed on that page is
highly dynamic and need to be refresed very often.

Now I would like to know the best way to achieve this.

I have heard of using the <meta http-equi='refresh'> or then maybe use
javascrip.

But is there nto anything build in the ASP.NET framework?


The best way to do this is to use JavaScript.

<head>
<script language="JavaScript">
function startTimer() {
setInterval(onTick,1000); // every second
}
function onTick() {
document.location.reload();
}
</script>
</head>
....
<body onLoad="startTimer();">
...
</body>

--
Ryan Walberg, B.Sc., MCSD, MCSD for .NET
ge*******@nospam.yahoo.com.nospam
Nov 18 '05 #3
I don't think ASP.NET has build feature that can do this.

I think one way is to put the data that needs to refresh frequently
into an IFrame, and make the page in the IFrame refresh at a regular
interval. This way you won't have to reload the entire page, but only
the data you need.

A more advance approach will be to have a hidden frame that constantly
poll data from the server, and only update the page when new data
arrives.

Both approach will require a lot more coding than simply refreshing
the entire page, so they might not be an option if it doesn't fit your
budget.

Tommy,

"francois" <fr******@bettinghouses.com_NOSPAM> wrote in message news:<e7**************@TK2MSFTNGP09.phx.gbl>...
I have an aspx page that needs to reload itself every x seconds. X is a
parameter retrieve from the DB or the web.config file, just to point out
that it will not be hardcoded.

I need to refresh the page as the information displayed on that page is
highly dynamic and need to be refresed very often.

Now I would like to know the best way to achieve this.

I have heard of using the <meta http-equi='refresh'> or then maybe use
javascrip.

But is there nto anything build in the ASP.NET framework?

Best regards,

Francois

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Lew | last post: by
19 posts views Thread by Darren | last post: by
5 posts views Thread by Khurram Hanif | last post: by
5 posts views Thread by Daniel | last post: by
1 post views Thread by Armand | last post: by
1 post views Thread by David C | last post: by
14 posts views Thread by =?Utf-8?B?UGF1bA==?= | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.