views:

34

answers:

2

Hi friends,

I have an asp.net web application in c# script.

I want this application page to refreh after every 30 seconds or 60 minutes of time.

I have written my codes in its page_load event.

http://localhost:1096/DisplayPop3Email.aspx?emailId=97

this is my url to refresh every 30 or 60 seconds.

also i want to change or increment the value of email with that

ie;

http://localhost:1096/DisplayPop3Email.aspx?emailId=98

http://localhost:1096/DisplayPop3Email.aspx?emailId=99

like that.

how can i do this.

my real task is to make this automatic.

how can i do this???

does anyone have an idea, please share it with me.....

Thanks

A: 

Start a timer on the page and when it counts down, you just refresh the page passing the new emailid parameter.

Chad Boyer
A: 

Actually, I would use a META tag for this.

<meta http-equiv="refresh" content="30;http://localhost:1096/DisplayPop3Email.aspx?emailId=97"&gt;

this is the logic I'd have in the page load

int email = 0
if !(RequestQueryString("EmailID") = null)
    email = (int)request.querystring("EmailID") +1 

HtmlMeta meta = new HtmlMeta();
meta.Name = "refresh";
meta.Content = "30; http://localhost:1096/DisplayPop3Email.aspx?emailId=" + email;
this.Header.Controls.Add(meta);

Notice that I'm doing the following things:

Using a META tag rather than a JS timer. This means that this will work regardless of browser/device.

I'm building my META tag in my code. This means that I can impact it every time (say I want to change every 30 seconds instead of 60 based on the counter)

Stephen Wrighton