back button problem

Discussion in 'ASP .Net' started by Hypo, Jul 24, 2003.

  1. Hypo

    Hypo Guest

    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
    Hypo, Jul 24, 2003
    #1
    1. Advertising

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

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "Hypo" <> wrote in message
    news:060101c351b1$bb3352b0$...
    > 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
    Steve C. Orr, MCSD, Jul 24, 2003
    #2
    1. Advertising

  3. Hypo

    Hypo Guest

    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/magazine/columns/qa/
    >
    >--
    >I hope this helps,
    >Steve C. Orr, MCSD
    >http://Steve.Orr.net
    >
    >
    >"Hypo" <> wrote

    in message
    >news:060101c351b1$bb3352b0$...
    >> 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

    >
    >
    >.
    >
    Hypo, Jul 24, 2003
    #3
  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" <> wrote in message
    news:0c4801c351e4$5304e950$...
    > 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/magazine/columns/qa/
    > >
    > >--
    > >I hope this helps,
    > >Steve C. Orr, MCSD
    > >http://Steve.Orr.net
    > >
    > >
    > >"Hypo" <> wrote

    > in message
    > >news:060101c351b1$bb3352b0$...
    > >> 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

    > >
    > >
    > >.
    > >
    Steve C. Orr, MCSD, Jul 24, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sylvia sil
    Replies:
    1
    Views:
    597
    Curt_C [MVP]
    Dec 29, 2004
  2. Chicagoboy27

    image button as a back button

    Chicagoboy27, Oct 26, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,998
    Chicagoboy27
    Oct 30, 2006
  3. phancey
    Replies:
    3
    Views:
    2,572
  4. Author
    Replies:
    6
    Views:
    3,069
    George
    Jan 22, 2009
  5. Useful Info

    Firefox back button takes me back 2 pages.

    Useful Info, Jun 3, 2007, in forum: Javascript
    Replies:
    0
    Views:
    332
    Useful Info
    Jun 3, 2007
Loading...

Share This Page