Re: Urgent! Inconsistent execution of Page_Load() method call
From: Itai (itaitai2003_at_yahoo.com)
Date: 08/05/04
- Next message: Oren: "Client-side handling of a treeview control"
- Previous message: Ken Cox [Microsoft MVP]: "Re: error installing IE web controls"
- In reply to: Itai: "Urgent! Inconsistent execution of Page_Load() method call"
- Messages sorted by: [ date ] [ thread ]
Date: 4 Aug 2004 20:00:08 -0700
Ok, so I added <%@ OutputCache Location="None" %> under the @Page
directive for Page1.aspx which seems to prevent IE from caching the
page thus, the debugger stops on page_load() regardless of the Trace
setting (case no.1 now shows a consistent behavior). I just wonder
why I explicitly need to disable OutputCache if I have never
explicitly enabled it and why this server-side caching feature can
affect client side caching behavior.
I also added <%@ OutputCache Location="None" %> under the @Page
directive for Page3.aspx however, what happens now is that regardless
of Trace setting I get the browser error message after hitting the
Back button
"Warning: Page has Expired
The page you requested was created using information you submitted in
a form…."
So, now case no.2 shows a consistent behavior but *not a correct one*
as I expect it to behave exactly as case no.1 (debugger stops on
Page_load() ).
I tried adding the following code as per kb183763 suggestion but it
does not work in my case.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;183763
<%
Response.CacheControl="public";
Response.Expires=0;
Response.AddHeader("pragma", "no-cache");
%>
itaitai2003@yahoo.com (Itai) wrote in message news:<429f6e7d.0408031926.20b8db37@posting.google.com>...
> 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
- Next message: Oren: "Client-side handling of a treeview control"
- Previous message: Ken Cox [Microsoft MVP]: "Re: error installing IE web controls"
- In reply to: Itai: "Urgent! Inconsistent execution of Page_Load() method call"
- Messages sorted by: [ date ] [ thread ]