Inconsistent execution of Page_Load() method call

I

Itai

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
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top