473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Page expiration

Ken
After searching through the visual studio .net help, and
searching on the web, I cannot find a difinitive way to
make a page expire so that when a user clicks on the back
button, the browser displays the "page has expireded"
message. I've not found any combinations of
response.cache members that provide for this
functionality. I'd appreciate any help.
Nov 17 '05 #1
4 964
Hi

Try the following code

response.Cache.Setexpires(somepastdate)
response.cache.setcacheability(Httpcacheability.no cache)

- Gopi
Nov 17 '05 #2
Gopi,

With this code in the page_load event

System.DateTime dt = new DateTime
(1961, 1, 5, 1, 1, 1, 1);
Response.Cache.SetExpires(dt);
Response.Cache.SetCacheability
(HttpCacheability.NoCache);
I can bring up the page, navigate to a different page,
then click my browsers back button and the page displays,
no "this page has expired message".
-----Original Message-----
Hi

Try the following code

response.Cache.Setexpires(somepastdate)
response.cache.setcacheability(Httpcacheability.n ocache)

- Gopi
.

Nov 17 '05 #3
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Ken" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
After searching through the visual studio .net help, and
searching on the web, I cannot find a difinitive way to
make a page expire so that when a user clicks on the back
button, the browser displays the "page has expireded"
message. I've not found any combinations of
response.cache members that provide for this
functionality. I'd appreciate any help.

Nov 17 '05 #4
Super! This works.

Thanks for the help.
-----Original Message-----
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com
"Ken" <an*******@discussions.microsoft.com> wrote in messagenews:00****************************@phx.gbl...
After searching through the visual studio .net help, and searching on the web, I cannot find a difinitive way to
make a page expire so that when a user clicks on the back button, the browser displays the "page has expireded"
message. I've not found any combinations of
response.cache members that provide for this
functionality. I'd appreciate any help.

.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: | last post by:
Which of these scenarios is better: A -- User Registers and is returned to the login screen to test his new username ie (email address). A login script checks user name against database....
3
by: Zaccariah Kowalsky | last post by:
Hello, I have a webapp with on each page a "language" drop down list. Now, if I choose X, I want to initialise the drop down list to X. Easy to understand. But what is the best way to do this in...
5
by: Kenneth Keeley | last post by:
Hi, I have a web app that has forms authentication and I can login to the page the first time I go there but it never times me out if I come back in 24 hours a hit the refresh key the page loads...
3
by: naijacoder naijacoder | last post by:
what i need i think its a session timeouts. Which i'm using like:- <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data...
2
by: Bill Borg | last post by:
Hello all, I am working on forms authentication and trying to understand: what's the relationship between the cookie expiration and the ticket expiration? I create a cookie and I add an...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
6
by: Sonnich | last post by:
Hi! How do I set the timeout for a page? Session.timeout is for the sesstion AFIAK. BR Sonnich
1
by: Danny Ni | last post by:
Hi, I have a page CourseEditor.aspx to allow users to modify course information. I am having problem with page expiration. Here are the steps I take to reproduce the problem: (1) I open a...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a site which I secure with forms authentication. When the user's sign on and hit one of the secure pages, I have this line in my code to ensure that the browser does not cache the page;...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.