473,320 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1619

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lew | last post by:
Hi all, I'm trying to create a page that has a user-selectable page auto-refresh option (IE 5.5). Essentially, it's a page that contains a checkbox, when the user checks the checkbox, I'd like...
19
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). ...
4
by: N. Demos | last post by:
Hello, I'm learning ASP.NET, and am having a strange problem with some example code from the book I'm using. The code increments and displays the value stored in a session variable when the "Add"...
5
by: Khurram Hanif | last post by:
I want to auto run asp.net page after a fixed interval of time without sending any request from browser to server. I dont want to use windows service or something like that. *** Sent via...
5
by: Daniel | last post by:
Hi All, i have problem to scroll the page the the specific section of the page after click a command button. I have tried using <a name="f"> and use response.redirect("xxxx.aspx?#f"). Although...
1
by: Armand | last post by:
Hi All, I have got a tricky prob here, Basically I'd like to refresh my aspx page on page load (once only) I put this following code on Page_load method: Response.Write("<SCRIPT...
11
by: C10B | last post by:
hi all, I have 3 drop down lists. When any of them changes there is an auto postback to do some server stuff. It is not always obvious (as a user) that a page reload has been started, and you...
1
by: David C | last post by:
Is it possible to have an aspx page reload every nn minutes? I assume I would have to do something in Javascript at the client? I want my ASP.Net application to display running dollars collected...
14
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I tried a google search but could not find anything. I am trying to cause one webpage to reload when a second web page is closed. The second webpage loads data into a session variable and when...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.