473,563 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Yet another Browser Back question

Hello all:

I note in my application, that when I use
Server.Transfer ("somepage.aspx "), when the new page is loaded, and I
click the Back button on the browser, that the previous page, when it
displays, does not appear to have its Page_Load event fire. Neither
does the page which I am leaving have its Page_Unload event fire.

Additionally, there is a listbox on the first page that is populated
based on user-selected values. This listbox, populated at
Server.Transfer time, is blank upon using the browser's Back button.

a) Why does Page_Load not fire upon return to first page when the back
button is pushed?
b) Why is my listbox depopulated?

Thanks much,
zdrakec

Nov 19 '05 #1
7 1955
Hi zdrakec, when you click the back button your browser is displaying locally
cached content and no call to the server is made. You could try to get around
it by setting a caching expiry date (in the past) or forcing _your_ browser
to always load afresh though this will not work for any one who hasnt also
got their browser set the same way HTH jd

"zdrakec" wrote:
Hello all:

I note in my application, that when I use
Server.Transfer ("somepage.aspx "), when the new page is loaded, and I
click the Back button on the browser, that the previous page, when it
displays, does not appear to have its Page_Load event fire. Neither
does the page which I am leaving have its Page_Unload event fire.

Additionally, there is a listbox on the first page that is populated
based on user-selected values. This listbox, populated at
Server.Transfer time, is blank upon using the browser's Back button.

a) Why does Page_Load not fire upon return to first page when the back
button is pushed?
b) Why is my listbox depopulated?

Thanks much,
zdrakec

Nov 19 '05 #2
Thank you london, can you describe precisely how one sets the caching
expiration date?

Thanks again,

zdrakec

Nov 19 '05 #3
Hello again, look at the response.cache object in particular:
Response.Cache. SetCacheability (HttpCacheabili ty.*)

Response.Cache. SetExpires(myDa te)

HTH jd

"zdrakec" wrote:
Thank you london, can you describe precisely how one sets the caching
expiration date?

Thanks again,

zdrakec

Nov 19 '05 #4
Thanks again london, please forgive me if I'm being a bit dense, but
I'm not sure WHERE to set this...in the second page's load event, or in
the same procedure that executes Server.Transfer ?

Cheers,

zdrakec

Nov 19 '05 #5
zdrakec wrote:
Thanks again london, please forgive me if I'm being a bit dense, but
I'm not sure WHERE to set this...in the second page's load event, or
in the same procedure that executes Server.Transfer ?

Cheers,

zdrakec


You set it in the page or code-behind class that produces the
HttpResponse, i.e. the actual output received by the client.

Cheers
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Nov 19 '05 #6
Thank you sir!

Nov 19 '05 #7
private void Page_Load(objec t sender, System.EventArg s 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 (HttpCacheabili ty.NoCache);
Response.Cache. SetExpires(Date Time.Now-new TimeSpan(1,0,0) );
Response.Cache. SetLastModified (DateTime.Now);
Response.Cache. SetAllowRespons eInBrowserHisto ry(false);
}
"zdrakec" wrote:
Thanks again london, please forgive me if I'm being a bit dense, but
I'm not sure WHERE to set this...in the second page's load event, or in
the same procedure that executes Server.Transfer ?

Cheers,

zdrakec

Nov 19 '05 #8

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

Similar topics

5
14398
by: bbxrider | last post by:
is it possible to mimic/invoke a browsers 'back' function, so the user could click a link/button/etc right on the page instead of being directed to 'use the browsers back button' if not html then perhaps java script? the problem i'm having is that i have a page that links out of cms page, can't really get the linked site content/page in my...
1
3201
by: Mark Johnson | last post by:
I wonder if anyone has a solution? I wanted to use the web browser control as a 'zoom' box for a smaller textbox. I can format in the control, and save whatever formatting as HTML code back to the textbox when the web browser is closed. The only problem comes in the use of numeric entities to specify Unicode. The web browser control is fine...
6
1636
by: David | last post by:
A user logs into a web site. He is then redirected to a web page of his choosing - based on menu options - for example: "WeeklyReport.aspx" is a page the user is currently viewing If the user session times out, I redirect the user to a "logoff.aspx" web page that now informs the user he must relogin to the web site Question: Is there anyway...
2
587
by: Dot net work | last post by:
Hello. I have an aspx page that changes an HTML label's text using javascript. After the label's text has been changed in this way, I redirect to another aspx page. If I then use the back button on the browser, the label has lost it's newly changed value.
15
1966
by: tshad | last post by:
I was looking for a way to handle refreshes (user pressed refresh button) and found a piece of code to check if a Web page was refreshed but I can't get it to work. The code is: ************************************************************ Namespace StevenBey.Web.UI Public Class Page Inherits System.Web.UI.Page
27
2702
by: David Golightly | last post by:
This is just a quick poll for all you web devs out there: What browsers do you test on/are concerned about compatibility with? Obviously, you're going to test on current-generation browsers such as IE6, IE7, Firefox 1.5/2, Opera 8/9, Safari 2, etc. How old must a browser be before you stop worrying about it? Anybody here still test on...
1
7051
by: joe | last post by:
Logout question I use a session to store the login information, say Session("Login") = success and use page_load to test the session("Login") success or not say If Session("Login") <success then response.redirect("LoginPage.aspx") But when i use logout to set Session("Login") = "" then redirect to LoginPage,
4
2218
by: Simon | last post by:
Another question. How can I disable the back- and forwardbutton of the browser? Thanks, Simon
1
1758
by: db007 | last post by:
Hi, I have a problem with a current project and the scroll position. I have an AJAX enabled website using Visual Studio 2005 and ASP.Net 2.0. The project also uses masterpages. On the page in question, there is a search section in an AJAX update panel, situated on the left hand side. Upon submitting criteria and pressing a button,...
0
7659
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.