Page_Load fires by using the BACK button in the browser

T

Todd A

Here is a simple example of the problem I am experiencing:

Page1.aspx
--has a simple html hyperlink that points to Page2.aspx

Page2.aspx
--has a simple html hyperlink that points to Page3.aspx and uses the
target="_blank" attribute, so Page3.aspx opens in a new window

Page3.aspx
--has just some static html information

Here is the problem

User starts on Page1, proceeds to Page2, and then to Page3 in a new window
User closes the browser window that has Page3
User now sees the browser window with Page2 in it.
User clicks the BACK button to get to Page1
Page1.Page_Load is executing, (but should not be)


All is fine except Page1.Page_Load firing. Why would the Page1.Page_Load
event fire by using the back button? Isn't Page1 supposed to be delivered
from the cache instead of initiating a server request?

If you take away the target="_blank" from the hyperlink on Page2, then
Page1.Page_Load does not fire in the above example. It seems opening a
webform in a new window is causing the problem.

Has anyone else experienced this, and if so, is there a methodolgy or fix
for preventing Page1.Page_Load?

Thanks,
 
B

bruce barker

loading in a new browser window usually forces a page refresh. caching in
the browser is optional, you can never count on it.

-- bruce (sqlwork.com)


| Here is a simple example of the problem I am experiencing:
|
| Page1.aspx
| --has a simple html hyperlink that points to Page2.aspx
|
| Page2.aspx
| --has a simple html hyperlink that points to Page3.aspx and uses the
| target="_blank" attribute, so Page3.aspx opens in a new window
|
| Page3.aspx
| --has just some static html information
|
| Here is the problem
|
| User starts on Page1, proceeds to Page2, and then to Page3 in a new window
| User closes the browser window that has Page3
| User now sees the browser window with Page2 in it.
| User clicks the BACK button to get to Page1
| Page1.Page_Load is executing, (but should not be)
|
|
| All is fine except Page1.Page_Load firing. Why would the Page1.Page_Load
| event fire by using the back button? Isn't Page1 supposed to be delivered
| from the cache instead of initiating a server request?
|
| If you take away the target="_blank" from the hyperlink on Page2, then
| Page1.Page_Load does not fire in the above example. It seems opening a
| webform in a new window is causing the problem.
|
| Has anyone else experienced this, and if so, is there a methodolgy or fix
| for preventing Page1.Page_Load?
|
| Thanks,
|
| --
| Todd Acheson
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top