How to expire a page (VB) ASP.NET

  • Thread starter Thread starter AuntieAuntieAuntie
  • Start date Start date
A

AuntieAuntieAuntie

There are two pages, A and B.
Page A is the Login page and Page B is the results presented fromthe stored
procedure as well as a table which contains buttons that the user uses to
clock in an out during the day. With option "C" and "D" listed below the
database results are expired but the table which contains the button for
clocking in an out remains visible. No Cache option works in classic ASP but
the same results I have not been able to reproduce in ASP.NET.


The user can navigate, using the submit button, from A to B and are free to
return to A using the back button but they MUST not be able to naviagate from
A to B using the forward button. How to disable or otherwise minimize this
from occuring?
I have tired to use the following to expire the page, but nothing is working
thus far; which is interesting as in classic ASP expiring a page is a
cake-walk, but not in ASP.NET. Oh goodness, please help.

Thank you.

I have tried:
A. 'Cache set to No Cache
Response.Buffer = True
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
Response.Expires = -1 '.Subtract(New TimeSpan(1, 0, 0, 0)).ToString()
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
Response.AppendHeader("Cache-Control", "no-cache")
Response.CacheControl = "no-cache"

B.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now)

C.
Session.Abandon()

D.
Session.Clear()
 
The database results are expired and not visible but the table which contains
the buttons for clocking in an out remains visible.

What else can I try?
 
Solution Found.
As a work around, instead of not allowing the user to go forward, they are
not prevented from going back.

Thanks.

Auntie
 
Back
Top