469,361 Members | 2,363 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

back button problem

I added a 'Back' button to my page, and wrote 'OnClick'
code something like this:

Response.Write("<script>history.go(-" +
iDepthIndex.ToString() + ");</script>");

But, it dosnt work! Effect is that browser navigates to
desired page as expected and go back from where it
started! But, the 'Back' button on browser works normaly.
I dont get it!!??

Thanks in advance,
Vedran
Nov 17 '05 #1
4 7370
Here's some back button code that may work out better for you:
http://www.ftponline.com/vsm/2003_07...ne/columns/qa/

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Hypo" <ve*****************@hypo-alpe-adria.com> wrote in message
news:06****************************@phx.gbl...
I added a 'Back' button to my page, and wrote 'OnClick'
code something like this:

Response.Write("<script>history.go(-" +
iDepthIndex.ToString() + ");</script>");

But, it dosnt work! Effect is that browser navigates to
desired page as expected and go back from where it
started! But, the 'Back' button on browser works normaly.
I dont get it!!??

Thanks in advance,
Vedran

Nov 17 '05 #2
Thanks for the link but thats not what i wanted. That
custom 'back' button uses Page.Redirect() method to
navigate and that is not acceptible because original page
(the page i want to return to) can go to several round-
trips and transformations and my intention is to go back
to exact same state of page what was left behind. Exactly
same behavior like browser 'back' button. I still cant
figure it out why JScript 'history.back()' doesn work
properly, any ideas ... ? And, btw, I navigate to that
page (with 'back' button) using Server.Transfer() method.

Thanks

-----Original Message-----
Here's some back button code that may work out better for you:http://www.ftponline.com/vsm/2003_07...ne/columns/qa/

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Hypo" <ve*****************@hypo-alpe-adria.com> wrote in messagenews:06****************************@phx.gbl...
I added a 'Back' button to my page, and wrote 'OnClick'
code something like this:

Response.Write("<script>history.go(-" +
iDepthIndex.ToString() + ");</script>");

But, it dosnt work! Effect is that browser navigates to
desired page as expected and go back from where it
started! But, the 'Back' button on browser works normaly. I dont get it!!??

Thanks in advance,
Vedran

.

Nov 17 '05 #3
Thanks for the link but thats not what i wanted. That
custom 'back' button uses Page.Redirect() method to
navigate and that is not acceptible because original page
(the page i want to return to) can go to several round-
trips and transformations and my intention is to go back
to exact same state of page what was left behind. Exactly
same behavior like browser 'back' button. I still cant
figure it out why JScript 'history.back()' doesn work
properly, any ideas ... ? And, btw, I navigate to that
page (with 'back' button) using Server.Transfer() method.

Thanks

-----Original Message-----
Here's some back button code that may work out better for you:http://www.ftponline.com/vsm/2003_07...ne/columns/qa/

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Hypo" <ve*****************@hypo-alpe-adria.com> wrote in messagenews:06****************************@phx.gbl...
I added a 'Back' button to my page, and wrote 'OnClick'
code something like this:

Response.Write("<script>history.go(-" +
iDepthIndex.ToString() + ");</script>");

But, it dosnt work! Effect is that browser navigates to
desired page as expected and go back from where it
started! But, the 'Back' button on browser works normaly. I dont get it!!??

Thanks in advance,
Vedran

.

Nov 17 '05 #4
OIC, well Server.Transfer is likely the cause of some of your headaches.
You see this operation happens entirely on the server and the browser is
never even notified. When you say history.back, you're telling the browser
to go back a page. So it does - according to it's history, not knowing
about the server.transfer that took place on the server. You may have
better luck if you use Response.Redirect instead since this happens through
the browser.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Hypo" <ve*****************@hypo-alpe-adria.com> wrote in message
news:0c****************************@phx.gbl...
Thanks for the link but thats not what i wanted. That
custom 'back' button uses Page.Redirect() method to
navigate and that is not acceptible because original page
(the page i want to return to) can go to several round-
trips and transformations and my intention is to go back
to exact same state of page what was left behind. Exactly
same behavior like browser 'back' button. I still cant
figure it out why JScript 'history.back()' doesn work
properly, any ideas ... ? And, btw, I navigate to that
page (with 'back' button) using Server.Transfer() method.

Thanks

-----Original Message-----
Here's some back button code that may work out better

for you:
http://www.ftponline.com/vsm/2003_07...ne/columns/qa/

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Hypo" <ve*****************@hypo-alpe-adria.com> wrote

in message
news:06****************************@phx.gbl...
I added a 'Back' button to my page, and wrote 'OnClick'
code something like this:

Response.Write("<script>history.go(-" +
iDepthIndex.ToString() + ");</script>");

But, it dosnt work! Effect is that browser navigates to
desired page as expected and go back from where it
started! But, the 'Back' button on browser works normaly. I dont get it!!??

Thanks in advance,
Vedran

.

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Peter D. Dunlap | last post: by
1 post views Thread by Johan Nedin | last post: by
8 posts views Thread by Shimon Sim | last post: by
29 posts views Thread by Tom wilson | last post: by
6 posts views Thread by tshad | last post: by
5 posts views Thread by ns21 | last post: by
7 posts views Thread by mohammed.naghman | last post: by
8 posts views Thread by =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post: by
8 posts views Thread by Harvey Schmidlapp | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.