Re: disable backward navigation of the browser

Discussion in 'ASP .Net' started by Steve C. Orr [MVP, MCSD], Mar 7, 2005.

  1. There's not really a great way to do this.
    I've heard of some people having some luck with the javascript
    history.forward() method.
    Another way is to pop open a new window, which will have no history and so
    the back button will be disabled.

    You can also try expiring the previous page.
    To prevent such page caching, use this code:
    Response.Expires = 0
    Response.Cache.SetNoStore()
    Response.AppendHeader("Pragma", "no-cache")

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


    "joseph blayil via .NET 247" <> wrote in message
    news:...
    > (Type your message here)
    >
    > --------------------------------
    > From: joseph blayil
    >
    > i want to disable backward navigation of the browser
    > eg: after signing out of yahoo we can't go to the last page visited
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>rjCZI+Gm2EqhSoJzdoHbOA==</Id>
     
    Steve C. Orr [MVP, MCSD], Mar 7, 2005
    #1
    1. Advertising

  2. I would recommend against going this route. It will frustrate users,
    and usability will suffer. If security is the issue, you can implement
    it in other ways. If a user signs out, and you don't want them to be
    able to go back, then Set Response.Expires to 0, as Steve suggests.

    Best regards,
    Jeffrey Palermo
    Blog: http://www.jeffreypalermo.com



    Steve C. Orr [MVP, MCSD] wrote:
    > There's not really a great way to do this.
    > I've heard of some people having some luck with the javascript
    > history.forward() method.
    > Another way is to pop open a new window, which will have no history

    and so
    > the back button will be disabled.
    >
    > You can also try expiring the previous page.
    > To prevent such page caching, use this code:
    > Response.Expires = 0
    > Response.Cache.SetNoStore()
    > Response.AppendHeader("Pragma", "no-cache")
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://SteveOrr.net
    >
    >
    > "joseph blayil via .NET 247" <> wrote in

    message
    > news:...
    > > (Type your message here)
    > >
    > > --------------------------------
    > > From: joseph blayil
    > >
    > > i want to disable backward navigation of the browser
    > > eg: after signing out of yahoo we can't go to the last page visited
    > >
    > > -----------------------
    > > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    > >
    > > <Id>rjCZI+Gm2EqhSoJzdoHbOA==</Id>
     
    Jeffrey Palermo, Mar 7, 2005
    #2
    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. eje

    Disable navigation buttons

    eje, Dec 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    526
    bruce barker
    Dec 2, 2004
  2. PJ6
    Replies:
    4
    Views:
    4,335
    Joerg Jooss
    Oct 14, 2005
  3. Laurahn
    Replies:
    3
    Views:
    940
    Steven Cheng[MSFT]
    Feb 6, 2007
  4. Jeff
    Replies:
    0
    Views:
    355
  5. Mirovk

    IE How to disable Navigation Bar

    Mirovk, Aug 26, 2006, in forum: ASP General
    Replies:
    2
    Views:
    296
    Aaron Bertrand [SQL Server MVP]
    Aug 27, 2006
Loading...

Share This Page