473,386 Members | 1,997 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,386 software developers and data experts.

Using the browser back arrow

In my application, I am setting cookies used for other pages based on the
current row selected. But when the user presses the 'back' button, the
pageload event does not get called and the record they are viewing does not
match the cookie and can lead to data entry errors. Is there a way to
resolve this?

Thanks,
Denise
Nov 19 '05 #1
1 1437

When browser back button clicked, the page is loaded from users cache.. one
way is to expire the first page , so that when the user clicks back button
from second page, the browser shows a message that page is not available,
forcing them to use the navigation provided in the site ..

private void Page_Load(object sender, System.EventArgs e)
{
ExpirePageCache();
//.......rest of the page_load logic....................
}
/// <summary>
/// This function prevent the page being retrieved from broswer cache
/// </summary>
private void ExpirePageCache()
{
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.Cache.SetExpires(DateTime.Now-new TimeSpan(1,0,0));
Response.Cache.SetLastModified(DateTime.Now);
Response.Cache.SetAllowResponseInBrowserHistory(fa lse);
}

Sreejith

"Denise" wrote:
In my application, I am setting cookies used for other pages based on the
current row selected. But when the user presses the 'back' button, the
pageload event does not get called and the record they are viewing does not
match the cookie and can lead to data entry errors. Is there a way to
resolve this?

Thanks,
Denise

Nov 19 '05 #2

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

Similar topics

2
by: Mike Berger | last post by:
I have a series of .asp pages that a user goes through to <I guess the purpose really doesn't matter>. On each page I have Response.Expires = 0 (which I understand to mean "do not cache this...
9
by: jcnews | last post by:
When designing a webpage, is there a way to disable the back button? It must be possible. I am asking because there are certain web applications that I have used that require the user to...
14
by: xxbmichae1 | last post by:
I have a <select> object that i've set up an onchange event that fires in IE fine when I use the cursor up and down in the list, but If I use the cursor up and down in Firefox the event doesn't...
5
by: skipc | last post by:
Hi, I am stuck... I've got a popup window that displays a list in table format with links on the bottom to navigate the list <prev> 1 2 3 ... <next> When I demo'd to the users... they...
8
by: sara | last post by:
I am learning Access and programming. I wanted to have the user select the departments for an ad from the list of all departments. Found code (that I could understand) on this site, and it works....
1
by: BrainTop | last post by:
This is driving me nuts for last one week. Appreciate any assistance. I have ASP.NET web application with many pages. Some of them post back to itself and then links to another page. Everything...
1
by: prasadsurya | last post by:
My requirement is, i need to capture an event when user closing browser i need to open a pop up window. I got the code which is working fine. But when i go forward and came back to the previous page...
0
by: Stan SR | last post by:
Hi, I need to customize a pargertemplate with these items a arrow to go back to the 1rst page a arrow for the previous page a dropdownlist with the page indexes a arrow for the new page a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.