Browser Back Button

Discussion in 'ASP .Net' started by DotNetGruven, Nov 9, 2004.

  1. DotNetGruven

    DotNetGruven Guest

    How are people handling the browser back button on database driven web apps
    built using ASP.NET??

    We keep state in Session and the back button is causing us lots of head
    aches!

    Is this just a situation where we should look harder at the way we use
    Session State or are their tricks and/or tips on this?

    TIA
    George
     
    DotNetGruven, Nov 9, 2004
    #1
    1. Advertising

  2. There is only one easy solution that I know of, and it's not practical in
    every situation:
    If you open a new browser window it will have no history, thus the back
    button will be disabled.

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


    "DotNetGruven" <> wrote in message
    news:...
    > How are people handling the browser back button on database driven web
    > apps built using ASP.NET??
    >
    > We keep state in Session and the back button is causing us lots of head
    > aches!
    >
    > Is this just a situation where we should look harder at the way we use
    > Session State or are their tricks and/or tips on this?
    >
    > TIA
    > George
    >
     
    Steve C. Orr [MVP, MCSD], Nov 9, 2004
    #2
    1. Advertising

  3. DotNetGruven

    Scott M. Guest

    The functionality of the Back button is not controllable. It is part of the
    client. The best you can do is expire your page content, but there is
    nothing you can do to disable the back button.


    "DotNetGruven" <> wrote in message
    news:...
    > How are people handling the browser back button on database driven web
    > apps built using ASP.NET??
    >
    > We keep state in Session and the back button is causing us lots of head
    > aches!
    >
    > Is this just a situation where we should look harder at the way we use
    > Session State or are their tricks and/or tips on this?
    >
    > TIA
    > George
    >
     
    Scott M., Nov 9, 2004
    #3
  4. I'd look hard at the design. What are the headaches? If you do need to
    control where "back" takes them, you can look at the js function
    location.replace(). Or, you might set a session variable so you can know not
    to execute a submit the second time around. Hard to know without more detail.

    Bill

    "DotNetGruven" wrote:

    > How are people handling the browser back button on database driven web apps
    > built using ASP.NET??
    >
    > We keep state in Session and the back button is causing us lots of head
    > aches!
    >
    > Is this just a situation where we should look harder at the way we use
    > Session State or are their tricks and/or tips on this?
    >
    > TIA
    > George
    >
    >
    >
     
    =?Utf-8?B?QmlsbCBCb3Jn?=, Nov 9, 2004
    #4
  5. Well u can disable it with Jscript by doing:-
    javascript:window.history.forward(1);



    "DotNetGruven" wrote:

    > How are people handling the browser back button on database driven web apps
    > built using ASP.NET??
    >
    > We keep state in Session and the back button is causing us lots of head
    > aches!
    >
    > Is this just a situation where we should look harder at the way we use
    > Session State or are their tricks and/or tips on this?
    >
    > TIA
    > George
    >
    >
    >
     
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 9, 2004
    #5
  6. DotNetGruven

    Scott M. Guest

    That doesn't disable the Back button. In fact, it will cause problems if
    the user has already hit the back button prior to arriving at the page in
    question.

    "Patrick.O.Ige" <> wrote in message
    news:...
    > Well u can disable it with Jscript by doing:-
    > javascript:window.history.forward(1);
    >
    >
    >
    > "DotNetGruven" wrote:
    >
    >> How are people handling the browser back button on database driven web
    >> apps
    >> built using ASP.NET??
    >>
    >> We keep state in Session and the back button is causing us lots of head
    >> aches!
    >>
    >> Is this just a situation where we should look harder at the way we use
    >> Session State or are their tricks and/or tips on this?
    >>
    >> TIA
    >> George
    >>
    >>
    >>
     
    Scott M., Nov 10, 2004
    #6
  7. DotNetGruven

    naija naija Guest

    Hi Scott,
    Yeah thanks alot for the advice.
    But that was my quick solution.
    Do you have any good way to do that?
    Patrick



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    naija naija, Nov 10, 2004
    #7
  8. DotNetGruven

    Scott M. Guest

    Response.Expires = date in the past

    "naija naija" <> wrote in message
    news:...
    > Hi Scott,
    > Yeah thanks alot for the advice.
    > But that was my quick solution.
    > Do you have any good way to do that?
    > Patrick
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Scott M., Nov 10, 2004
    #8
  9. DotNetGruven

    naija naija Guest

    Hi Scott,
    Can you explain in detail how it works?
    thx


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    naija naija, Nov 11, 2004
    #9
  10. DotNetGruven

    Scott M. Guest

    By setting this value on a web page, you are indicating to the server that
    the page content is no longer valid. The page content will expire
    immediately. You can't disable the Back button, but if the page content has
    expired, when the user does hit the back button, the client will display
    "Page Expired" instead of the page.

    "naija naija" <> wrote in message
    news:%...
    > Hi Scott,
    > Can you explain in detail how it works?
    > thx
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Scott M., Nov 11, 2004
    #10
  11. DotNetGruven

    naija naija Guest

    thx Scott ur too cool:)
    Nice Idea!

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    naija naija, Nov 11, 2004
    #11
    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. Replies:
    3
    Views:
    7,177
  2. Steve C. Orr, MCSD

    Re: Browser-History-Back Button

    Steve C. Orr, MCSD, Aug 15, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    2,196
    mathieu cupryk
    Aug 16, 2003
  3. sylvia sil
    Replies:
    1
    Views:
    621
    Curt_C [MVP]
    Dec 29, 2004
  4. Author
    Replies:
    6
    Views:
    3,101
    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:
    347
    Useful Info
    Jun 3, 2007
Loading...

Share This Page