By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,320 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,320 IT Pros & Developers. It's quick & easy.

Inconsistent execution of Page_Load() method call

P: n/a
Background:

I have four Web Form pages with respective C# code behind files,
all in the same project:

localhost/vpath1

Page1.aspx
Page2.aspx

Localhost/vpath2

Page3.aspx
Page4.aspx
I am encountering two issues with respect to Page1.aspx and Page3.aspx
Page_Load() method execution.
Case no.1:

Page1.aspx has five Webcontrols: 4 DropDownList and 1 Button

DropDownList1 is set to auto post back on "SelectedIndexChanged" and
populates DropDownList2 with appropriate entries.

DropDownList3 is set to auto post back on "SelectedIndexChanged" and
populates DropDownList4 with appropriate entries.

Button submits the form and redirects to Page2.aspx on (Page.IsValid)
using Response.Redirect
The problem:

Setting *** Trace = "true" *** in Page1.aspx, putting a breakpoint on
its Page_Load() and running the page in debug mode results in the
following behavior:
1. Debugger stops on Page1.Page_Load() - press cont.
2. Change DropDownList1
3. Debugger stops on Page1.Page_Load() - press cont.
4. Change DropDownList3
5. Debugger stops on Page1.Page_Load() - press cont.
6. Click Button
7. Debugger stops on Page1.Page_Load() - press cont.
8. Page2.aspx displays
9. Press browser Back button
10. Debugger stops on Page1.Page_Load() - press cont.
11. Page1.aspx displays

Setting *** Trace = "false" *** in Page1.aspx, putting a breakpoint on
its Page_Load() and running the page in debug mode results in the
following behavior:
1. Debugger stops on Page1.Page_Load() - press cont.
2. Change DropDownList1
3. Debugger stops on Page1.Page_Load() - press cont.
4. Change DropDownList3
5. Debugger stops on Page1.Page_Load() - press cont.
6. Click Button
7. Debugger stops on Page1.Page_Load() - press cont.
8. Page2.aspx displays
9. Press browser Back button
10. Page1.aspx displays (No debugger stop on Page1.Page_Load() )

Case no.2:

Page3.aspx has 3 Webcontrols: 2 DropDownList and 1 Button

DropDownList1 is set to auto post back on "SelectedIndexChanged" and
populates DropDownList2 with appropriate entries.

Button submits the form and redirects to Page4.aspx on (Page.IsValid)
using Response.Redirect
The problem:

Setting *** Trace = "true" *** in Page3.aspx, putting a breakpoint on
its Page_Load() and running the page in debug mode results in the
following behavior:

1. Debugger stops on Page3.Page_Load() - press cont.
2. Change DropDownList1
3. Debugger stops on Page3.Page_Load() - press cont.
4. Click Button
5. Debugger stops on Page3.Page_Load() - press cont.
6. Page4.aspx displays
7. Press browser Back button
8. Browser displays the following message:

"Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available.
As a security precaution, Internet Explorer does not automatically
resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh
button."

Setting *** Trace = "false" *** in Page3.aspx, putting a breakpoint on
its Page_Load() and running the page in debug mode results in the
following behavior:

1. Debugger stops on Page3.Page_Load() - press cont.
2. Change DropDownList1
3. Debugger stops on Page3.Page_Load() - press cont.
4. Click Button
5. Debugger stops on Page3.Page_Load() - press cont.
6. Page4.aspx displays
7. Press browser Back button
8. Page3.aspx displays (No debugger stop on Page3.Page_Load() )

Can anyone explain this behavior, I'm quite desperate?

Thanks in advance,

-Itai.
p.s

All pages have "this.Load += new System.EventHandler(this.Page_Load);"
properly set in InitializeComponent()
* I'm using IE 6sp1
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.