Page Expiration

Discussion in 'ASP .Net' started by Nitin, Mar 3, 2005.

  1. Nitin

    Nitin Guest

    When the user logs out from my user page I don't want him to be able to come
    bak to that page by pressing the 'Back' button of the browser.

    i use this code in the page_load event
    '
    Response.Expires = 0
    Response.Cache.SetNoStore()
    Response.AppendHeader("Pragma", "no-cache")
    '
    It doesn't seem to work. Please suggest.
    Regards,
    Nitin
    Nitin, Mar 3, 2005
    #1
    1. Advertising

  2. Hi Nitin,

    If the system time on the client is earlier than the system time on the
    server (because of either the client or server having an inaccurate time
    setting, or time-zone differences), setting the parameter to 0 does not have
    the effect of expiring the page immediately. You can use the
    Response.ExpiresAbsolute property to immediately expire a page. In addition,
    you can use a negative number for the Expires property to expire the response
    immediately.

    Response.Expires = -1

    Cheers,

    Jerome. M


    "Nitin" wrote:

    > When the user logs out from my user page I don't want him to be able to come
    > bak to that page by pressing the 'Back' button of the browser.
    >
    > i use this code in the page_load event
    > '
    > Response.Expires = 0
    > Response.Cache.SetNoStore()
    > Response.AppendHeader("Pragma", "no-cache")
    > '
    > It doesn't seem to work. Please suggest.
    > Regards,
    > Nitin
    >
    >
    >
    =?Utf-8?B?RG90TmV0SmVyb21l?=, Mar 3, 2005
    #2
    1. Advertising

  3. Nitin,
    U can't actually disable the BACK button.
    But u can use the javascript below to do the trick
    javascript:window.history.forward(1);
    Hope it helps
    Patrick



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Mar 3, 2005
    #3
    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. Ken

    Page expiration

    Ken, Nov 1, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    1,120
    Guest
    Nov 3, 2003
  2. Vijay
    Replies:
    3
    Views:
    1,471
    Saravana [MVP]
    Nov 4, 2003
  3. Josh Anderson - remove Zs to reply

    Page expiration warning on back navigation

    Josh Anderson - remove Zs to reply, Nov 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,335
    Saravana [MVP]
    Nov 19, 2003
  4. naijacoder naijacoder

    Page expiration - Is it with Session.Timeout

    naijacoder naijacoder, Sep 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    436
    Greg Burns
    Sep 9, 2004
  5. Mustufa Baig

    Setting Page Expiration...

    Mustufa Baig, Apr 1, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,924
    Mustufa Baig
    Apr 5, 2005
Loading...

Share This Page