views:

189

answers:

1

Hi friends,

Please help me to do this

I want to refresh my web page in every fixed time period.

i have done with a javascript timer.

But actually i'm not refreshing the same page, it will go to next page after each refreah.

I'm developing a web application in asp.net c#

for example my url will look like this

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

after each javascript refresh i want to increase the value of emailId

ie

after the next refresh my url will look like this

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

i have use a javascript function to refreh this web page after a fixed time (for example 30 second)

but how can i increase the value of emailid after each refresh...

below is my javascript code.

i have called the the doload() inside another javascript function.

see below

function openNewWindow(spcd,cval) { //alert("hello"); var tt = spcd; //alert(tt); var testarray=(spcd).split('@%@'); //alert(testarray); for(i=0;i

i have called this openNewWindow(spcd) function inside my asp.net page_load event ...

please help me to increment my emailid after each refresh....

Thanks.

+1  A: 

Call the function below:

function goToNextId() {
  var id = 1 + parseInt(window.location.href.match(/emailId=(\d+)/)[1]);
  window.location.href = window.location.href.replace(/emailId=(\d+)/, "emailId=" + id);
}
Dmytrii Nagirniak