back button problem

H

Hypo

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
 
H

Hypo

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
 
S

Steve C. Orr, MCSD

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top