By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,887 Members | 1,003 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,887 IT Pros & Developers. It's quick & easy.

back button problem

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.