I'm working on an asp.net 3.5 web site. I have added close buttons on my pages and used a javascript function to return to the page that opened the current page. To accomplish this I count when the page is first opened and every time the page is submitted.
The active javascript code is
history.go (-iSubmitCount) where iSubmitCount is the count.
This works great if the count <= 4. Above 4 it doesn't work.
I have tested the functionality by using the IE Back button instead and it only keeps track of the pages for <=4.
Is there a website or IE setting that I can use to change this?
I'm working on an asp.net 3.5 web site. I have added close buttons on my pages and used a javascript function to return to the page that opened the current page. To accomplish this I count when the page is first opened and every time the page is submitted.
The active javascript code is
history.go (-iSubmitCount) where iSubmitCount is the count.
This works great if the count <= 4. Above 4 it doesn't work.
I have tested the functionality by using the IE Back button instead and it only keeps track of the pages for <=4.
Is there a website or IE setting that I can use to change this?
Thanks for your help.
You need a different approach. If you have to do something to your browser to get you js to work, it won't work for other people.
I suggest storing the url of the page that opened the current page as a variable and using window.location to go back.
thanks for your reply. I have used the history.go(-#) strategy on many asp websites and it worked great. I have also tried the go to URL and have had problems with that approach on highly interactive pages where the user needs to open multiple different
pages and return to the page.
I have read the w3schools description of the history.go method and my code is correct . It definitely does not work on my system if a page has been submitted more than 4 times when using either Casini and IIS. The IE back button suffers from the same problem.
Are you telling me that on your system you can post a page back more than 4 times and the history.go (-#) is working properly.
I thought I would check to see if there might be something wrong with my system since the history.go (-#) is not working properly, so I created a new web site on a different box and created test pages. On the test sytem, histor.go(-#) works as shown in
the W3Schools documentation.
However it does not work in the ASP.Net 3.5 web site that I'm developing for my client. In tracing the history of pages, it stops at 4. So my question is, does anyone know of javascript or cs coding that might affect a page's history. I'm using the CommandName
= "Update" to post the pages. I open pages from javascript with location = "URL".
DeepPowder
Member
173 Points
360 Posts
maximum number for history.go
Dec 28, 2012 02:07 PM|LINK
I'm working on an asp.net 3.5 web site. I have added close buttons on my pages and used a javascript function to return to the page that opened the current page. To accomplish this I count when the page is first opened and every time the page is submitted. The active javascript code is
history.go (-iSubmitCount) where iSubmitCount is the count.
This works great if the count <= 4. Above 4 it doesn't work.
I have tested the functionality by using the IE Back button instead and it only keeps track of the pages for <=4.
Is there a website or IE setting that I can use to change this?
Thanks for your help.
Dan Bracuk
Contributor
3970 Points
1096 Posts
Re: maximum number for history.go
Dec 28, 2012 02:40 PM|LINK
You need a different approach. If you have to do something to your browser to get you js to work, it won't work for other people.
I suggest storing the url of the page that opened the current page as a variable and using window.location to go back.
DeepPowder
Member
173 Points
360 Posts
Re: maximum number for history.go
Dec 28, 2012 04:48 PM|LINK
thanks for your reply. I have used the history.go(-#) strategy on many asp websites and it worked great. I have also tried the go to URL and have had problems with that approach on highly interactive pages where the user needs to open multiple different pages and return to the page.
Still looking for a history.go (-#) approach
Song-Tian - ...
All-Star
43705 Points
4304 Posts
Microsoft
Re: maximum number for history.go
Dec 31, 2012 07:53 AM|LINK
Hi,
I also test the code on my side. And that is runing normal. Please check your code again. And for history.go(), please refer to: http://www.w3schools.com/jsref/met_his_go.asp .
Feedback to us
Develop and promote your apps in Windows Store
DeepPowder
Member
173 Points
360 Posts
Re: maximum number for history.go
Jan 08, 2013 03:39 PM|LINK
I have read the w3schools description of the history.go method and my code is correct . It definitely does not work on my system if a page has been submitted more than 4 times when using either Casini and IIS. The IE back button suffers from the same problem. Are you telling me that on your system you can post a page back more than 4 times and the history.go (-#) is working properly.
Thanks for your help.
DeepPowder
Member
173 Points
360 Posts
Re: maximum number for history.go
Jan 08, 2013 05:56 PM|LINK
I thought I would check to see if there might be something wrong with my system since the history.go (-#) is not working properly, so I created a new web site on a different box and created test pages. On the test sytem, histor.go(-#) works as shown in the W3Schools documentation.
However it does not work in the ASP.Net 3.5 web site that I'm developing for my client. In tracing the history of pages, it stops at 4. So my question is, does anyone know of javascript or cs coding that might affect a page's history. I'm using the CommandName = "Update" to post the pages. I open pages from javascript with location = "URL".
Thanks for your help.