Professional Web Applications Themes

back button problem - ASP.NET General

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...

  1. #1

    Default 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
    Hypo Guest

  2. #2

    Default Re: back button problem

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

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


    "Hypo" <vedran.bilopavlovichypo-alpe-adria.com> wrote in message
    news:060101c351b1$bb3352b0$a601280aphx.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

    Steve C. Orr, MCSD Guest

  3. #3

    Default Re: back button problem

    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:
    >[url]http://www.ftponline.com/vsm/2003_07/magazine/columns/qa/[/url]
    >
    >--
    >I hope this helps,
    >Steve C. Orr, MCSD
    >[url]http://Steve.Orr.net[/url]
    >
    >
    >"Hypo" <vedran.bilopavlovichypo-alpe-adria.com> wrote
    in message
    >news:060101c351b1$bb3352b0$a601280aphx.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
    >
    >
    >.
    >
    Hypo Guest

  4. #4

    Default Re: back button problem

    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
    [url]http://Steve.Orr.net[/url]


    "Hypo" <vedran.bilopavlovichypo-alpe-adria.com> wrote in message
    news:0c4801c351e4$5304e950$a401280aphx.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:
    > >[url]http://www.ftponline.com/vsm/2003_07/magazine/columns/qa/[/url]
    > >
    > >--
    > >I hope this helps,
    > >Steve C. Orr, MCSD
    > >[url]http://Steve.Orr.net[/url]
    > >
    > >
    > >"Hypo" <vedran.bilopavlovichypo-alpe-adria.com> wrote
    > in message
    > >news:060101c351b1$bb3352b0$a601280aphx.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
    > >
    > >
    > >.
    > >

    Steve C. Orr, MCSD Guest

Similar Threads

  1. Browser Back button problem
    By GMK in forum ASP.NET Security
    Replies: 6
    Last Post: April 25th, 01:42 PM
  2. ASP and Back Button problem.
    By GW in forum Web Design
    Replies: 1
    Last Post: November 6th, 06:41 PM
  3. Page has Expired, BACK-button -problem
    By Jarkko Kähkönen in forum PHP Development
    Replies: 2
    Last Post: October 1st, 10:13 PM
  4. [PHP] Session problem in back button
    By Murugesan in forum PHP Development
    Replies: 1
    Last Post: August 26th, 05:13 PM
  5. Back button on the browser problem
    By shimonsim@talamus.com in forum ASP.NET General
    Replies: 3
    Last Post: June 29th, 12:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139