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

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

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

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,248
    Guest
    Nov 3, 2003
  2. Vijay
    Replies:
    3
    Views:
    1,675
    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,423
    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:
    580
    Greg Burns
    Sep 9, 2004
  5. Mustufa Baig

    Setting Page Expiration...

    Mustufa Baig, Apr 1, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,116
    Mustufa Baig
    Apr 5, 2005
  6. kpg

    page expiration

    kpg, Jun 17, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    2,968
    \jason via DotNetMonster.com\
    Jul 6, 2005
  7. Jason Kendall

    Automatic Page Content Expiration

    Jason Kendall, Aug 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    535
    Jason Kendall
    Aug 1, 2005
  8. Jure Erznoznik

    Page expiration problem

    Jure Erznoznik, Aug 3, 2005, in forum: HTML
    Replies:
    3
    Views:
    2,252
    Jure Erznoznik
    Aug 4, 2005
Loading...