473,473 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Page_Load on browser Back button

Is there a way to get the Page_Load event to fire if the user clicks the
Back button on the browser rather than clicking a hyperlink ?
Jan 14 '08 #1
3 4219
"Ian Semmel" <an****@rocketcomp.com.auwrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Is there a way to get the Page_Load event to fire if the user clicks the
Back button on the browser rather than clicking a hyperlink ?
I don't think so, because it's down to the browser to post back to trigger
the event, and most browsers just pull back a cached copy. If there was a
postback previously on the page then in IE the user gets the "Page has
expired" messagebox which prompts them to repost the form data, but they
might not, and reposting the data may mess your app up.

You could try telling the browser not to cache the page, but I don't think
this would work. You're better off telling the user not to click back in
their browser, and providing a very clear "Back" button or hyperlink.

Jan 14 '08 #2
If you have prevented caching on the original page, then yes the browser
would actually re-request the page rather than displaying the content from
it's cache.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Ian Semmel" wrote:
Is there a way to get the Page_Load event to fire if the user clicks the
Back button on the browser rather than clicking a hyperlink ?
Jan 14 '08 #3
disabling caching causes the repost dialog box. you are better off designing
your site to allow use of the back button and caching. you users will be
happer. you shoudl also handle repost of the same page (refresh).

-- bruce (sqlwork.com)
"Peter Bromberg [C# MVP]" wrote:
If you have prevented caching on the original page, then yes the browser
would actually re-request the page rather than displaying the content from
it's cache.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Ian Semmel" wrote:
Is there a way to get the Page_Load event to fire if the user clicks the
Back button on the browser rather than clicking a hyperlink ?

Jan 14 '08 #4

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

Similar topics

16
by: thejackofall | last post by:
Hi. I have a button called btnSelect on a web form. There is a handler for it. However, the Page_Load() gets called before the handler gets called. I want to do the following. In the...
0
by: Itai | last post by:
Background: I have four Web Form pages with respective C# code behind files, all in the same project: localhost/vpath1 Page1.aspx Page2.aspx
2
by: Timo | last post by:
I've set my aspx page to expire immediately using the management console, HTTP headers tab. Considering this scenario: a user visits the aspx page in question, then moves to another page, then...
7
by: Sridhar | last post by:
Hi, I have a question regarding the Page_Load method and Back Button of Internet explorer. I have created a webform. In that webform I have several Text Boxes. Also I have two buttons. When I...
3
by: ericw3 | last post by:
I am testing the code snippets of John Peterson ( http://www.asp101.com/articles/john/codebehindnovs/default.asp ). I have WebForm2.vb as follows: Public Class WebForm2 Inherits...
6
by: dwclark | last post by:
I am having an issue when I trigger a Response.Redirect, the Page_Load fires on the page where the Response.Redirect was called. From what I've read, this should not happen and the browser should...
17
by: Arpan | last post by:
When a Button is clicked in a Web Form in an ASPX page, the Form will post back to itself. Under such circumstances (i.e. when a Button is clicked), will the Page_Load sub execute first & then will...
8
by: John Austin | last post by:
I need to understand why if I add a control and use AddHandler to connect its click event, it will work in Page_Load, but not in a Button_Click. The idea is that the user types some data, presses...
1
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...
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
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...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.