Urgent! Inconsistent execution of Page_Load() method call

Discussion in 'ASP .Net Web Controls' started by Itai, Aug 4, 2004.

  1. Itai

    Itai Guest

    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
    Itai, Aug 4, 2004
    #1
    1. Advertising

  2. Itai,

    It's impossible to say for sure without examining your configuration.
    However, I'd say the following is the issue:

    Case no 1:
    The page is being cached. Therefore, it is not being executed and the
    breakpoint is not being hit. This is normal.

    Case no 2:
    See http://support.microsoft.com/default.aspx?scid=KB;EN-US;183763.

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: (Itai)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Subject: Urgent! Inconsistent execution of Page_Load() method call
    >Date: 3 Aug 2004 20:26:44 -0700
    >Organization: http://groups.google.com
    >Lines: 134
    >Message-ID: <>
    >NNTP-Posting-Host: 203.145.159.41
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1091590004 13284 127.0.0.1 (4 Aug 2004

    03:26:44 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Wed, 4 Aug 2004 03:26:44 +0000 (UTC)
    >Path:

    cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
    ul.t-online.de!t-online.de!news.glorb.com!postnews2.google.com!not-for-mail
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:22511
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >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
    >
    Jim Cheshire [MSFT], Aug 4, 2004
    #2
    1. Advertising

  3. Itai

    Itai Guest

    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");
    %>





    (Itai) wrote in message news:<>...
    > 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
    Itai, Aug 5, 2004
    #3
  4. Itai

    Itai Guest

    More on case no.1
    *****************

    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

    Sum: case no.1 now shows a consistent behavior after hitting the back
    button.

    HTTP trace response for Page1.aspx using <%@ OutputCache
    Location="None" %>

    ---------------------------------------------------------------
    RESPONSE:

    HTTP/1.1 200 OK
    Server: Microsoft-IIS/5.1
    Date: Thu, 05 Aug 2004 08:31:04 GMT
    X-Powered-By: ASP.NET
    X-AspNet-Version: 1.1.4322
    Set-Cookie: ASP.NET_SessionId=xbxyr5imyxbxhivifnk23wfj; path=/
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: -1
    Content-Type: text/html; charset=utf-8
    Content-Length: 35213
    ----------------------------------------------------------------

    I just wonder why I explicitly need to disable OutputCache if I never
    had explicitly enabled it and why does this server-side caching
    feature (OutputCache) affects client side caching behavior (IE cache).


    More on case no.2
    *****************

    I added <%@ OutputCache Location="None" %> under the @Page directive
    for Page3.aspx however, what happens now is that regardless of the
    Trace setting
    I get the following 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 an invalid but consistent behavior regardless
    of the Tarce settings. I expect it to behave exactly as in case no.1
    (the debugger should stop on Page3.Page_load()after hitting the back
    button ).

    I tried adding the following code to Page3.aspx as per kb183763,
    despite the fact that in case no.1 (Page1.aspx) it does not require it
    to work properly, nevertheless adding the code still does not solve
    the problem.

    <%Response.CacheControl="public";%>


    HTTP response trace for Page3.aspx using:
    <%@ OutputCache Location="None" %>
    <% Response.CacheControl="public";%>

    ----------------------------------------------------------------
    RESPONSE:
    HTTP/1.1 200 OK
    Server: Microsoft-IIS/5.1
    Date: Thu, 05 Aug 2004 08:14:20 GMT
    X-Powered-By: ASP.NET
    X-AspNet-Version: 1.1.4322
    Set-Cookie: ASP.NET_SessionId=bzmpvkrqby5b3cmo2lbmswvu; path=/
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: -1
    Content-Type: text/html; charset=utf-8
    Content-Length: 65376
    -----------------------------------------------------------------


    (Jim Cheshire [MSFT]) wrote in message news:<>...
    > Itai,
    >
    > It's impossible to say for sure without examining your configuration.
    > However, I'd say the following is the issue:
    >
    > Case no 1:
    > The page is being cached. Therefore, it is not being executed and the
    > breakpoint is not being hit. This is normal.
    >
    > Case no 2:
    > See http://support.microsoft.com/default.aspx?scid=KB;EN-US;183763.
    >
    > Jim Cheshire [MSFT]
    > MCP+I, MCSE, MCSD, MCDBA
    > Microsoft Developer Support
    >
    >
    > This post is provided "AS-IS" with no warranties and confers no rights.
    Itai, Aug 5, 2004
    #4
  5. Regarding case 1, it doesn't matter how you accomplish it, you need to
    prevent the client from hitting a cached copy if you want to page to
    execute. The default for OutputCache is Any. If you want to change the
    default, you need to do so explicitly.

    Don't make the mistake of thinking that OutputCache is only server-side
    caching. The documentation on the directive will give you more
    information, but suffice it to say that the default setting of Any
    specifies that the page can be cached on any device that is capable of
    caching content. Therefore, unless the browser is set to not cache the
    page, it will be cached on the client.

    Regarding case 2, what happens is this. When you click the Back button, IE
    is looking for the page in the Temporary Internet Files folder. If it
    doesn't find the page, it displays that message. The reason why it's not
    finding that page is because you have set the OutputCache with a location
    of None. That causes the page to not be cached.

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.


    --------------------
    >From: (Itai)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Subject: Re: Urgent! Inconsistent execution of Page_Load() method call
    >Date: 5 Aug 2004 00:07:03 -0700
    >Organization: http://groups.google.com
    >Lines: 99
    >Message-ID: <>
    >References: <>

    <>
    >NNTP-Posting-Host: 203.145.159.42
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1091689624 27147 127.0.0.1 (5 Aug 2004

    07:07:04 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Thu, 5 Aug 2004 07:07:04 +0000 (UTC)
    >Path:

    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
    e.de!news.glorb.com!postnews2.google.com!not-for-mail
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:22624
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >More on case no.1
    >*****************
    >
    >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
    >
    >Sum: case no.1 now shows a consistent behavior after hitting the back
    >button.
    >
    >HTTP trace response for Page1.aspx using <%@ OutputCache
    >Location="None" %>
    >
    >---------------------------------------------------------------
    >RESPONSE:
    >
    >HTTP/1.1 200 OK
    >Server: Microsoft-IIS/5.1
    >Date: Thu, 05 Aug 2004 08:31:04 GMT
    >X-Powered-By: ASP.NET
    >X-AspNet-Version: 1.1.4322
    >Set-Cookie: ASP.NET_SessionId=xbxyr5imyxbxhivifnk23wfj; path=/
    >Cache-Control: no-cache
    >Pragma: no-cache
    >Expires: -1
    >Content-Type: text/html; charset=utf-8
    >Content-Length: 35213
    >----------------------------------------------------------------
    >
    >I just wonder why I explicitly need to disable OutputCache if I never
    >had explicitly enabled it and why does this server-side caching
    >feature (OutputCache) affects client side caching behavior (IE cache).
    >
    >
    >More on case no.2
    >*****************
    >
    >I added <%@ OutputCache Location="None" %> under the @Page directive
    >for Page3.aspx however, what happens now is that regardless of the
    >Trace setting
    >I get the following 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 an invalid but consistent behavior regardless
    >of the Tarce settings. I expect it to behave exactly as in case no.1
    >(the debugger should stop on Page3.Page_load()after hitting the back
    >button ).
    >
    >I tried adding the following code to Page3.aspx as per kb183763,
    >despite the fact that in case no.1 (Page1.aspx) it does not require it
    >to work properly, nevertheless adding the code still does not solve
    >the problem.
    >
    ><%Response.CacheControl="public";%>
    >
    >
    >HTTP response trace for Page3.aspx using:
    ><%@ OutputCache Location="None" %>
    ><% Response.CacheControl="public";%>
    >
    >----------------------------------------------------------------
    >RESPONSE:
    >HTTP/1.1 200 OK
    >Server: Microsoft-IIS/5.1
    >Date: Thu, 05 Aug 2004 08:14:20 GMT
    >X-Powered-By: ASP.NET
    >X-AspNet-Version: 1.1.4322
    >Set-Cookie: ASP.NET_SessionId=bzmpvkrqby5b3cmo2lbmswvu; path=/
    >Cache-Control: no-cache
    >Pragma: no-cache
    >Expires: -1
    >Content-Type: text/html; charset=utf-8
    >Content-Length: 65376
    >-----------------------------------------------------------------
    >
    >
    > (Jim Cheshire [MSFT]) wrote in message

    news:<>...
    >> Itai,
    >>
    >> It's impossible to say for sure without examining your configuration.
    >> However, I'd say the following is the issue:
    >>
    >> Case no 1:
    >> The page is being cached. Therefore, it is not being executed and the
    >> breakpoint is not being hit. This is normal.
    >>
    >> Case no 2:
    >> See http://support.microsoft.com/default.aspx?scid=KB;EN-US;183763.
    >>
    >> Jim Cheshire [MSFT]
    >> MCP+I, MCSE, MCSD, MCDBA
    >> Microsoft Developer Support
    >>
    >>
    >> This post is provided "AS-IS" with no warranties and confers no rights.

    >
    Jim Cheshire [MSFT], Aug 5, 2004
    #5
  6. Itai

    Itai Guest

    Ok, I think I am able to pinpoint what causes the problem in case
    no.2.
    I have identified it to be related to the Page3 custom validation
    controls and validation summary control

    Following are exact repro steps.

    Repro:

    1. Set breakpoint on Page3.aspx Page_Load()
    2. Run Page3.aspx in debug mode
    3. [Debugger stops on Page3.Page_Load()] – press cont.
    4. Press submit button
    5. [Debugger stops on Page3.Page_Load()] – press cont.
    6. Page4.aspx displays
    7. Press Back button
    8. Page3.aspx displays //
    9. [Debugger stops on Page3.Page_Load()] – press cont.

    // Up until now everything ok.

    9. Perform an illegal selection in Page3.aspx (in my test
    environment it's just selecting a value in the DropDownList which is
    out of range for a custom validation control – specifics are
    meaningless,I just use it to raise an error for the test)

    10. Press submit button
    11. [Debugger stops on Page3.Page_Load()] – press cont
    12. Page3 displays the validation summary error
    // here is where I think the root of the problem.

    13. Reset the DropDownList to a valid value.
    14. Press submit button
    15. [Debugger stops on Page3.Page_Load()] – press cont.
    // validation passes ok
    16. Page4.aspx displays
    17. Press Back button
    18. Browser displays the following error

    "Warning: Page has Expired
    The page you requested was created using information you submitted in
    a form…."


    I need to be able to get back to Page3.Page_Load()! (Like in step 9)
    Itai, Aug 6, 2004
    #6
  7. Itai,

    The reason IE displays that message is that it cannot find the requested
    resource in Temporary Internet Files. In the case yesterday, it was
    because you had manipulated the OutputCache and set it to None.

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.


    --------------------
    >From: (Itai)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Subject: Re: Urgent! Inconsistent execution of Page_Load() method call
    >Date: 5 Aug 2004 22:08:26 -0700
    >Organization: http://groups.google.com
    >Lines: 45
    >Message-ID: <>
    >References: <>

    <>
    <>
    <>
    >NNTP-Posting-Host: 203.145.159.42
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1091768943 26414 127.0.0.1 (6 Aug 2004

    05:09:03 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Fri, 6 Aug 2004 05:09:03 +0000 (UTC)
    >Path:

    cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08
    .phx.gbl!newsfeed00.sul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.
    net!postnews2.google.com!not-for-mail
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:22648
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >Ok, I think I am able to pinpoint what causes the problem in case
    >no.2.
    >I have identified it to be related to the Page3 custom validation
    >controls and validation summary control
    >
    >Following are exact repro steps.
    >
    >Repro:
    >
    >1. Set breakpoint on Page3.aspx Page_Load()
    >2. Run Page3.aspx in debug mode
    >3. [Debugger stops on Page3.Page_Load()] – press cont.
    >4. Press submit button
    >5. [Debugger stops on Page3.Page_Load()] – press cont.
    >6. Page4.aspx displays
    >7. Press Back button
    >8. Page3.aspx displays //
    >9. [Debugger stops on Page3.Page_Load()] – press cont.
    >
    >// Up until now everything ok.
    >
    >9. Perform an illegal selection in Page3.aspx (in my test
    >environment it's just selecting a value in the DropDownList which is
    >out of range for a custom validation control – specifics are
    >meaningless,I just use it to raise an error for the test)
    >
    >10. Press submit button
    >11. [Debugger stops on Page3.Page_Load()] – press cont
    >12. Page3 displays the validation summary error
    >// here is where I think the root of the problem.
    >
    >13. Reset the DropDownList to a valid value.
    >14. Press submit button
    >15. [Debugger stops on Page3.Page_Load()] – press cont.
    >// validation passes ok
    >16. Page4.aspx displays
    >17. Press Back button
    >18. Browser displays the following error
    >
    >"Warning: Page has Expired
    >The page you requested was created using information you submitted in
    >a form…."
    >
    >
    >I need to be able to get back to Page3.Page_Load()! (Like in step 9)
    >
    Jim Cheshire [MSFT], Aug 6, 2004
    #7
  8. Itai

    Itai Guest

    (Jim Cheshire [MSFT]) wrote in message news:<>...
    > Itai,
    >
    > The reason IE displays that message is that it cannot find the requested
    > resource in Temporary Internet Files. In the case yesterday, it was
    > because you had manipulated the OutputCache and set it to None.


    Well, the whole Repro was done using <%@ OutputCache Location="None"
    %>
    So how do you explain things to work properly through steps 2 - 9?
    (see repro below)

    I mean if a page is not in the cache then the browser should attempt
    reconnect to the server and re-fetch the page.


    [Summary of steps 2 – 9]

    1. Page3.aspx displays (IE does not cache the page)
    2. Page4.aspx displays after Page3 submit
    3. Page3.aspx displays after hitting the back button although it was
    not cached initially. [IE Re fetches the page from the server]

    What I assume is the following:

    In step 12, where the browser displays Page3.aspx with the validations
    summary error it actually logs the response as "Dynamic Page3.aspx -
    in response to a post".
    When I re-post the page with valid parameters the server instructs the
    browser to redirect to Page4.aspx however the browser still remembers
    that the last response was to a "dynamically generated page". Thus,
    when I hit the back button it looks in the cache for "Dynamic
    Page3.aspx - in response to a post" and *not* for "Page3.aspx" which
    results in the error page:

    "Warning: Page has Expired
    The page you requested was created using information you submitted in
    a form..."

    Is that a correct analysis?


    Repro:
    ******
    1. Set breakpoint on Page3.aspx Page_Load()
    2. Run Page3.aspx in debug mode
    3. [Debugger stops on Page3.Page_Load()] ? press cont.
    4. Press submit button
    5. [Debugger stops on Page3.Page_Load()] ? press cont.

    [ everything works ok from here ]
    6. Page4.aspx displays
    7. Press Back button
    8. Page3.aspx displays //
    9. [Debugger stops on Page3.Page_Load()] ? press cont.

    // Up until now everything ok.

    9. Perform an illegal selection in Page3.aspx (in my test
    environment it's just selecting a value in the DropDownList which is
    out of range for a custom validation control ? specifics are
    meaningless,I just use it to raise an error for the test)

    10. Press submit button
    11. [Debugger stops on Page3.Page_Load()] ? press cont
    12. Page3 displays the validation summary error
    // here is where I think the root of the problem.

    13. Reset the DropDownList to a valid value.
    14. Press submit button
    15. [Debugger stops on Page3.Page_Load()] ? press cont.
    // validation passes ok
    16. Page4.aspx displays
    17. Press Back button
    18. Browser displays the following error

    "Warning: Page has Expired
    The page you requested was created using information you submitted in
    a form?."

    I need to be able to get back to Page3.Page_Load()! (Like in step 9)
    Itai, Aug 7, 2004
    #8
  9. Itai,

    I'm not sure what else I can tell you other than the reason you are seeing
    that message. If the page is not in Temporary ASP.NET Files, it will
    display that message. The page was the result of a POST. Therefore, you
    have to repost the data explicitly to see the page again.

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: (Itai)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Subject: Re: Urgent! Inconsistent execution of Page_Load() method call
    >Date: 6 Aug 2004 23:01:08 -0700
    >Organization: http://groups.google.com
    >Lines: 81
    >Message-ID: <>
    >References: <>

    <>
    <>
    <>
    <>
    <>
    >NNTP-Posting-Host: 203.145.159.40
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1091858504 31785 127.0.0.1 (7 Aug 2004

    06:01:44 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Sat, 7 Aug 2004 06:01:44 +0000 (UTC)
    >Path:

    cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
    ul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!border1.nntp.dca.gi
    ganews.com!nntp.giganews.com!news.glorb.com!postnews2.google.com!not-for-mai
    l
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:22687
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    > (Jim Cheshire [MSFT]) wrote in message

    news:<>...
    >> Itai,
    >>
    >> The reason IE displays that message is that it cannot find the requested
    >> resource in Temporary Internet Files. In the case yesterday, it was
    >> because you had manipulated the OutputCache and set it to None.

    >
    >Well, the whole Repro was done using <%@ OutputCache Location="None"
    >%>
    >So how do you explain things to work properly through steps 2 - 9?
    >(see repro below)
    >
    >I mean if a page is not in the cache then the browser should attempt
    >reconnect to the server and re-fetch the page.
    >
    >
    >[Summary of steps 2 – 9]
    >
    >1. Page3.aspx displays (IE does not cache the page)
    >2. Page4.aspx displays after Page3 submit
    >3. Page3.aspx displays after hitting the back button although it was
    >not cached initially. [IE Re fetches the page from the server]
    >
    >What I assume is the following:
    >
    >In step 12, where the browser displays Page3.aspx with the validations
    >summary error it actually logs the response as "Dynamic Page3.aspx -
    >in response to a post".
    >When I re-post the page with valid parameters the server instructs the
    >browser to redirect to Page4.aspx however the browser still remembers
    >that the last response was to a "dynamically generated page". Thus,
    >when I hit the back button it looks in the cache for "Dynamic
    >Page3.aspx - in response to a post" and *not* for "Page3.aspx" which
    >results in the error page:
    >
    >"Warning: Page has Expired
    >The page you requested was created using information you submitted in
    >a form..."
    >
    >Is that a correct analysis?
    >
    >
    >Repro:
    >******
    >1. Set breakpoint on Page3.aspx Page_Load()
    >2. Run Page3.aspx in debug mode
    >3. [Debugger stops on Page3.Page_Load()] ? press cont.
    >4. Press submit button
    >5. [Debugger stops on Page3.Page_Load()] ? press cont.
    >
    >[ everything works ok from here ]
    >6. Page4.aspx displays
    >7. Press Back button
    >8. Page3.aspx displays //
    >9. [Debugger stops on Page3.Page_Load()] ? press cont.
    >
    >// Up until now everything ok.
    >
    >9. Perform an illegal selection in Page3.aspx (in my test
    >environment it's just selecting a value in the DropDownList which is
    >out of range for a custom validation control ? specifics are
    >meaningless,I just use it to raise an error for the test)
    >
    >10. Press submit button
    >11. [Debugger stops on Page3.Page_Load()] ? press cont
    >12. Page3 displays the validation summary error
    >// here is where I think the root of the problem.
    >
    >13. Reset the DropDownList to a valid value.
    >14. Press submit button
    >15. [Debugger stops on Page3.Page_Load()] ? press cont.
    >// validation passes ok
    >16. Page4.aspx displays
    >17. Press Back button
    >18. Browser displays the following error
    >
    >"Warning: Page has Expired
    >The page you requested was created using information you submitted in
    >a form?."
    >
    >I need to be able to get back to Page3.Page_Load()! (Like in step 9)
    >
    Jim Cheshire [MSFT], Aug 9, 2004
    #9
  10. Itai

    Itai Guest

    Mystery solved using smartNavigation as detailed in the following
    post:

    -------------------------------------------------------------------------------
    From: Steven Cheng[MSFT] ()
    Subject: RE: How to prevent Postback URL's from being added to browser
    history
    Newsgroups: microsoft.public.dotnet.framework.aspnet
    Date: 2004-01-15 21:34:13 PST

    http://groups.google.co.in/groups?h...ser+history&ie=UTF-8&hl=en&btnG=Google+Search
    -------------------------------------------------------------------------------

    Thanks anyway,

    -Itai.
    Itai, Aug 10, 2004
    #10
  11. Ahhh. Good workaround. Thank for posting that.

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.


    --------------------
    >From: (Itai)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Subject: Re: Urgent! Inconsistent execution of Page_Load() method call
    >Date: 9 Aug 2004 21:26:36 -0700
    >Organization: http://groups.google.com
    >Lines: 16
    >Message-ID: <>
    >References: <>

    <>
    <>
    <>
    <>
    <>
    <>
    <>
    >NNTP-Posting-Host: 203.145.159.40
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1092111997 28358 127.0.0.1 (10 Aug 2004

    04:26:37 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Tue, 10 Aug 2004 04:26:37 +0000 (UTC)
    >Path:

    cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08
    .phx.gbl!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali
    .net!proxad.net!postnews2.google.com!not-for-mail
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:22721
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >Mystery solved using smartNavigation as detailed in the following
    >post:
    >
    >---------------------------------------------------------------------------

    ----
    >From: Steven Cheng[MSFT] ()
    >Subject: RE: How to prevent Postback URL's from being added to browser
    >history
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >Date: 2004-01-15 21:34:13 PST
    >
    >http://groups.google.co.in/groups?hl=en&lr=&ie=UTF-8&threadm=waTZJJ$2DHA.

    432%40cpmsftngxa08.phx.gbl&rnum=1&prev=/groups%3Fq%3DRE%253A%2BHow%2Bto%2Bpr
    event%2BPostback%2BURL%27s%2Bfrom%2Bbeing%2Badded%2Bto%2Bbrowser%2Bhistory%2
    6ie%3DUTF-8%26hl%3Den%26btnG%3DGoogle%2BSearch
    >---------------------------------------------------------------------------

    ----
    >
    >Thanks anyway,
    >
    >-Itai.
    >
    Jim Cheshire [MSFT], Aug 10, 2004
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bminder
    Replies:
    1
    Views:
    2,154
    nfedin
    Feb 23, 2004
  2. Itai
    Replies:
    0
    Views:
    435
  3. z. f.
    Replies:
    0
    Views:
    551
    z. f.
    Oct 19, 2004
  4. lonelyplanet999

    Inconsistent execution output

    lonelyplanet999, Nov 18, 2003, in forum: Java
    Replies:
    5
    Views:
    312
    Thyme
    Nov 20, 2003
  5. rockdale
    Replies:
    1
    Views:
    650
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
Loading...

Share This Page