Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Page has Expired - using html input control (type=file)

Question posted by: Nathan (Guest) on November 19th, 2005 05:00 PM
I have an aspx page with a data grid, some textboxes, and an update button.
This page also has one html input element with type=file (not inside the data
grid and runat=server).

The update button will verify the information that has been entered and
updates the data base if the data is correct. Update will throw an exception
if the data is not validate based on some given rules. I also have a custom
error handling page to show the exceptions (following lines).

protected void Application_Error(Object sender, EventArgs e)
{
Exception ex = Server.GetLastError().GetBaseException();
Session["MyErr"] = ex.Message.ToString();
Server.ClearError();
Response.Write("<script language='javascript'>history.go(-1);
window.open('MyErrorPage.aspx','Error','scrollbars =yes,width=500,height=120');</script>");
}

My problem is that when I get the exception on my aspx page (generated by
the update) and try to go to my previous page (history.go(-1)) I get the
“Warning: Page has Expired” message and when I refresh the page I loose all
my changes. The page was showing up fine before adding the input element.

Is there a way to avoid getting the “Page has Expired” message?

Thank you,

Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Steven Cheng[MSFT]'s Avatar
Steven Cheng[MSFT]
Guest
n/a Posts
November 19th, 2005
05:01 PM
#2

Re: Page has Expired - using html input control (type=file)
Hi Nathan,

Welcome to ASPNET newsgroup.
From your description, you're redireting the current user to a custom error
page and make the main window display the previous page when there occurs
unhandled exceptio in the asp.net app. However, you're always gettting the
"page has Expired ..." message,yes?

As for the "Page has expired..." message, it is populated by the clientside
browser when the browser find a certain page record's clientside cache has
expired or event haven't been cached at clientside. So what's the page
you're gong to navigate back through the history.go(-1); ? If it's the
pages in the same web application, then have they been set some expiration
policy which makes them expired immediately (not cached ) at client side?
Or have you tested visting the application from some other clients to see
whether all the clients will have the same behavior so as to make sure this
is not a clientside browsr setting issue.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| Thread-Topic: Page has Expired - using html input control (type=file)
| thread-index: AcWjgRNz1ihCOTGJT5CTuex0V4sWFg==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| Subject: Page has Expired - using html input control (type=file)
| Date: Wed, 17 Aug 2005 16:12:02 -0700
| Lines: 27
| Message-ID: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118762
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have an aspx page with a data grid, some textboxes, and an update
button.
| This page also has one html input element with type=file (not inside the
data
| grid and runat=server).
|
| The update button will verify the information that has been entered and
| updates the data base if the data is correct. Update will throw an
exception
| if the data is not validate based on some given rules. I also have a
custom
| error handling page to show the exceptions (following lines).
|
| protected void Application_Error(Object sender, EventArgs e)
| {
| Exception ex = Server.GetLastError().GetBaseException();
| Session["MyErr"] = ex.Message.ToString();
| Server.ClearError();
| Response.Write("<script language='javascript'>history.go(-1);
|
window.open('MyErrorPage.aspx','Error','scrollbars =yes,width=500,height=120'
);</script>");
| }
|
| My problem is that when I get the exception on my aspx page (generated by
| the update) and try to go to my previous page (history.go(-1)) I get the
| “Warning: Page has Expired?message and when I refresh the page I
loose all
| my changes. The page was showing up fine before adding the input element.
|
| Is there a way to avoid getting the “Page has Expired?message?
|
| Thank you,
|
|


Nathan's Avatar
Nathan
Guest
n/a Posts
November 19th, 2005
05:04 PM
#3

Re: Page has Expired - using html input control (type=file)
Yes. It used to work fine and I was able to see the page, but once I added
the html input tag to my page I start getting the Page has Expired message.

We don’t have any expiration set for the client side pages. I tested my page
on Netscape 7.2 and it works fine (I don’t get the Page Expired).

Here is a sample setup to recreate this problem:
1- Create a web application
2- In WebForm1.aspx add three controls
<asp:Button id="Button1" runat="server"
Text="Button1"></asp:Button>
<INPUT type="file" id="cFile" runat="server">
<asp:Button id="Button2" runat="server"
Text="Button2"></asp:Button>
3- Update the Global.asax
protected void Application_Error(Object sender, EventArgs e)
{
Response.Clear();
Exception objErr = Server.GetLastError().GetBaseException();
Session["MyErr"] = objErr.Message.ToString();
Server.ClearError();
Response.Write("<SCRIPT
language='javascript'>history.go(-1);
window.open('http://www.msn.ca','PopUp','scrollbars=yes,width=500,heig ht=400');</SCRIPT>");
}
4- For each one of the Buttons create an onclick event handler
5- In the onclick event of Button2 put the following line of code
throw new Exception("My exception");
6- Run the application
7- First click button1 and then click button2, you should see the Page has
Expired message

Note: If you remove the INPUT control (or remove the runat=server from INPUT
control) the error won't happen.



"Steven Cheng[MSFT]" wrote:
[color=blue]
> Hi Nathan,
>
> Welcome to ASPNET newsgroup.
> From your description, you're redireting the current user to a custom error
> page and make the main window display the previous page when there occurs
> unhandled exceptio in the asp.net app. However, you're always gettting the
> "page has Expired ..." message,yes?
>
> As for the "Page has expired..." message, it is populated by the clientside
> browser when the browser find a certain page record's clientside cache has
> expired or event haven't been cached at clientside. So what's the page
> you're gong to navigate back through the history.go(-1); ? If it's the
> pages in the same web application, then have they been set some expiration
> policy which makes them expired immediately (not cached ) at client side?
> Or have you tested visting the application from some other clients to see
> whether all the clients will have the same behavior so as to make sure this
> is not a clientside browsr setting issue.
>
> Thanks,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
>
> --------------------
> | Thread-Topic: Page has Expired - using html input control (type=file)
> | thread-index: AcWjgRNz1ihCOTGJT5CTuex0V4sWFg==
> | X-WBNR-Posting-Host: 209.17.159.193
> | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | Subject: Page has Expired - using html input control (type=file)
> | Date: Wed, 17 Aug 2005 16:12:02 -0700
> | Lines: 27
> | Message-ID: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 8bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:118762
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | I have an aspx page with a data grid, some textboxes, and an update
> button.
> | This page also has one html input element with type=file (not inside the
> data
> | grid and runat=server).
> |
> | The update button will verify the information that has been entered and
> | updates the data base if the data is correct. Update will throw an
> exception
> | if the data is not validate based on some given rules. I also have a
> custom
> | error handling page to show the exceptions (following lines).
> |
> | protected void Application_Error(Object sender, EventArgs e)
> | {
> | Exception ex = Server.GetLastError().GetBaseException();
> | Session["MyErr"] = ex.Message.ToString();
> | Server.ClearError();
> | Response.Write("<script language='javascript'>history.go(-1);
> |
> window.open('MyErrorPage.aspx','Error','scrollbars =yes,width=500,height=120'
> );</script>");
> | }
> |
> | My problem is that when I get the exception on my aspx page (generated by
> | the update) and try to go to my previous page (history.go(-1)) I get the
> | “Warning: Page has Expired�message and when I refresh the page I
> loose all
> | my changes. The page was showing up fine before adding the input element.
> |
> | Is there a way to avoid getting the “Page has Expired�message?
> |
> | Thank you,
> |
> |
>
>[/color]

Steven Cheng[MSFT]'s Avatar
Steven Cheng[MSFT]
Guest
n/a Posts
November 19th, 2005
05:05 PM
#4

Re: Page has Expired - using html input control (type=file)
Thanks for your response Nathan,

As for the behavior you mentioned, it is likely due to browser's history
behavior for handling post submit history. When we put input entry fields
on page and hit submit , this request contains forms data ,and when we hit
back button, the browser may prevent the content from displaying .
However, by default this should not happen since based on my local
test(through the steps you provided) , I didn't ecounter the "page
expired..." warning message. I'm thinking whether your webserver has
configured some certain http header which cause the behavior. Have you
checked your IIS server to see whether there are any http headers
configured in the site or virtual dir setting?

Also, you can test on some other server to see whether you also get this
behavior. To test this, we can simply create a page which has a text field
and a submit button. After submit the page through the submit button , hit
the "back" button on browser to see whether you can correctly get the
previous view of the page.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| Thread-Topic: Page has Expired - using html input control (type=file)
| thread-index: AcWkJWm3DrbB0rf3RnWcVkmF7Y1jcQ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
<COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: Page has Expired - using html input control (type=file)
| Date: Thu, 18 Aug 2005 11:48:26 -0700
| Lines: 131
| Message-ID: <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118964
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Yes. It used to work fine and I was able to see the page, but once I
added
| the html input tag to my page I start getting the Page has Expired
message.
|
| We don’t have any expiration set for the client side pages. I tested my
page
| on Netscape 7.2 and it works fine (I don’t get the Page Expired).
|
| Here is a sample setup to recreate this problem:
| 1- Create a web application
| 2- In WebForm1.aspx add three controls
| <asp:Button id="Button1" runat="server"
| Text="Button1"></asp:Button>
| <INPUT type="file" id="cFile" runat="server">
| <asp:Button id="Button2" runat="server"
| Text="Button2"></asp:Button>
| 3- Update the Global.asax
| protected void Application_Error(Object sender, EventArgs e)
| {
| Response.Clear();
| Exception objErr =
Server.GetLastError().GetBaseException();
| Session["MyErr"] = objErr.Message.ToString();
| Server.ClearError();
| Response.Write("<SCRIPT
| language='javascript'>history.go(-1);
|
window.open('http://www.msn.ca','PopUp','scrollbars=yes,width=500,heig ht=400
');</SCRIPT>");
| }
| 4- For each one of the Buttons create an onclick event handler
| 5- In the onclick event of Button2 put the following line of code
| throw new Exception("My exception");
| 6- Run the application
| 7- First click button1 and then click button2, you should see the Page
has
| Expired message
|
| Note: If you remove the INPUT control (or remove the runat=server from
INPUT
| control) the error won't happen.
|
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Nathan,
| >
| > Welcome to ASPNET newsgroup.
| > From your description, you're redireting the current user to a custom
error
| > page and make the main window display the previous page when there
occurs
| > unhandled exceptio in the asp.net app. However, you're always gettting
the
| > "page has Expired ..." message,yes?
| >
| > As for the "Page has expired..." message, it is populated by the
clientside
| > browser when the browser find a certain page record's clientside cache
has
| > expired or event haven't been cached at clientside. So what's the page
| > you're gong to navigate back through the history.go(-1); ? If it's the
| > pages in the same web application, then have they been set some
expiration
| > policy which makes them expired immediately (not cached ) at client
side?
| > Or have you tested visting the application from some other clients to
see
| > whether all the clients will have the same behavior so as to make sure
this
| > is not a clientside browsr setting issue.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: Page has Expired - using html input control (type=file)
| > | thread-index: AcWjgRNz1ihCOTGJT5CTuex0V4sWFg==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| > | Subject: Page has Expired - using html input control (type=file)
| > | Date: Wed, 17 Aug 2005 16:12:02 -0700
| > | Lines: 27
| > | Message-ID: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 8bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:118762
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I have an aspx page with a data grid, some textboxes, and an update
| > button.
| > | This page also has one html input element with type=file (not inside
the
| > data
| > | grid and runat=server).
| > |
| > | The update button will verify the information that has been entered
and
| > | updates the data base if the data is correct. Update will throw an
| > exception
| > | if the data is not validate based on some given rules. I also have a
| > custom
| > | error handling page to show the exceptions (following lines).
| > |
| > | protected void Application_Error(Object sender, EventArgs e)
| > | {
| > | Exception ex = Server.GetLastError().GetBaseException();
| > | Session["MyErr"] = ex.Message.ToString();
| > | Server.ClearError();
| > | Response.Write("<script language='javascript'>history.go(-1);
| > |
| >
window.open('MyErrorPage.aspx','Error','scrollbars =yes,width=500,height=120'
| > );</script>");
| > | }
| > |
| > | My problem is that when I get the exception on my aspx page
(generated by
| > | the update) and try to go to my previous page (history.go(-1)) I get
the
| > | “Warning: Page has Expiredâ?message and when I refresh the
page I
| > loose all
| > | my changes. The page was showing up fine before adding the input
element.
| > |
| > | Is there a way to avoid getting the “Page has Expired
?message?
| > |
| > | Thank you,
| > |
| > |
| >
| >
|


Nathan's Avatar
Nathan
Guest
n/a Posts
November 19th, 2005
05:07 PM
#5

Re: Page has Expired - using html input control (type=file)
Thanks Steven,

We are using the default settings for the page expiration on the IIS (check
box cleared). In order to get the error you have to have ‘runat=server’ set
for the input control. You also have to first click on the Button1 to do a
postback and then Button2 to throw the exception (the order of clicking the
buttons is important to create the error).

"Steven Cheng[MSFT]" wrote:
[color=blue]
> Thanks for your response Nathan,
>
> As for the behavior you mentioned, it is likely due to browser's history
> behavior for handling post submit history. When we put input entry fields
> on page and hit submit , this request contains forms data ,and when we hit
> back button, the browser may prevent the content from displaying .
> However, by default this should not happen since based on my local
> test(through the steps you provided) , I didn't ecounter the "page
> expired..." warning message. I'm thinking whether your webserver has
> configured some certain http header which cause the behavior. Have you
> checked your IIS server to see whether there are any http headers
> configured in the site or virtual dir setting?
>
> Also, you can test on some other server to see whether you also get this
> behavior. To test this, we can simply create a page which has a text field
> and a submit button. After submit the page through the submit button , hit
> the "back" button on browser to see whether you can correctly get the
> previous view of the page.
>
> Thanks,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
>
> --------------------
> | Thread-Topic: Page has Expired - using html input control (type=file)
> | thread-index: AcWkJWm3DrbB0rf3RnWcVkmF7Y1jcQ==
> | X-WBNR-Posting-Host: 209.17.159.193
> | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
> | Subject: RE: Page has Expired - using html input control (type=file)
> | Date: Thu, 18 Aug 2005 11:48:26 -0700
> | Lines: 131
> | Message-ID: <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 8bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:118964
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | Yes. It used to work fine and I was able to see the page, but once I
> added
> | the html input tag to my page I start getting the Page has Expired
> message.
> |
> | We don’t have any expiration set for the client side pages. I tested my
> page
> | on Netscape 7.2 and it works fine (I don’t get the Page Expired).
> |
> | Here is a sample setup to recreate this problem:
> | 1- Create a web application
> | 2- In WebForm1.aspx add three controls
> | <asp:Button id="Button1" runat="server"
> | Text="Button1"></asp:Button>
> | <INPUT type="file" id="cFile" runat="server">
> | <asp:Button id="Button2" runat="server"
> | Text="Button2"></asp:Button>
> | 3- Update the Global.asax
> | protected void Application_Error(Object sender, EventArgs e)
> | {
> | Response.Clear();
> | Exception objErr =
> Server.GetLastError().GetBaseException();
> | Session["MyErr"] = objErr.Message.ToString();
> | Server.ClearError();
> | Response.Write("<SCRIPT
> | language='javascript'>history.go(-1);
> |
> window.open('http://www.msn.ca','PopUp','scrollbars=yes,width=500,heig ht=400
> ');</SCRIPT>");
> | }
> | 4- For each one of the Buttons create an onclick event handler
> | 5- In the onclick event of Button2 put the following line of code
> | throw new Exception("My exception");
> | 6- Run the application
> | 7- First click button1 and then click button2, you should see the Page
> has
> | Expired message
> |
> | Note: If you remove the INPUT control (or remove the runat=server from
> INPUT
> | control) the error won't happen.
> |
> |
> |
> | "Steven Cheng[MSFT]" wrote:
> |
> | > Hi Nathan,
> | >
> | > Welcome to ASPNET newsgroup.
> | > From your description, you're redireting the current user to a custom
> error
> | > page and make the main window display the previous page when there
> occurs
> | > unhandled exceptio in the asp.net app. However, you're always gettting
> the
> | > "page has Expired ..." message,yes?
> | >
> | > As for the "Page has expired..." message, it is populated by the
> clientside
> | > browser when the browser find a certain page record's clientside cache
> has
> | > expired or event haven't been cached at clientside. So what's the page
> | > you're gong to navigate back through the history.go(-1); ? If it's the
> | > pages in the same web application, then have they been set some
> expiration
> | > policy which makes them expired immediately (not cached ) at client
> side?
> | > Or have you tested visting the application from some other clients to
> see
> | > whether all the clients will have the same behavior so as to make sure
> this
> | > is not a clientside browsr setting issue.
> | >
> | > Thanks,
> | >
> | > Steven Cheng
> | > Microsoft Online Support
> | >
> | > Get Secure! www.microsoft.com/security
> | > (This posting is provided "AS IS", with no warranties, and confers no
> | > rights.)
> | >
> | >
> | >
> | >
> | > --------------------
> | > | Thread-Topic: Page has Expired - using html input control (type=file)
> | > | thread-index: AcWjgRNz1ihCOTGJT5CTuex0V4sWFg==
> | > | X-WBNR-Posting-Host: 209.17.159.193
> | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | > | Subject: Page has Expired - using html input control (type=file)
> | > | Date: Wed, 17 Aug 2005 16:12:02 -0700
> | > | Lines: 27
> | > | Message-ID: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> | > | MIME-Version: 1.0
> | > | Content-Type: text/plain;
> | > | charset="Utf-8"
> | > | Content-Transfer-Encoding: 8bit
> | > | X-Newsreader: Microsoft CDO for Windows 2000
> | > | Content-Class: urn:content-classes:message
> | > | Importance: normal
> | > | Priority: normal
> | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | > | Path:
> TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
> | > | Xref: TK2MSFTNGXA01.phx.gbl
> | > microsoft.public.dotnet.framework.aspnet:118762
> | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> | > |
> | > | I have an aspx page with a data grid, some textboxes, and an update
> | > button.
> | > | This page also has one html input element with type=file (not inside
> the
> | > data
> | > | grid and runat=server).
> | > |
> | > | The update button will verify the information that has been entered
> and
> | > | updates the data base if the data is correct. Update will throw an
> | > exception
> | > | if the data is not validate based on some given rules. I also have a
> | > custom
> | > | error handling page to show the exceptions (following lines).
> | > |
> | > | protected void Application_Error(Object sender, EventArgs e)
> | > | {
> | > | Exception ex = Server.GetLastError().GetBaseException();
> | > | Session["MyErr"] = ex.Message.ToString();
> | > | Server.ClearError();
> | > | Response.Write("<script language='javascript'>history.go(-1);
> | > |
> | >
> window.open('MyErrorPage.aspx','Error','scrollbars =yes,width=500,height=120'
> | > );</script>");
> | > | }
> | > |
> | > | My problem is that when I get the exception on my aspx page
> (generated by
> | > | the update) and try to go to my previous page (history.go(-1)) I get
> the
> | > | “Warning: Page has Expiredâ�message and when I refresh the
> page I
> | > loose all
> | > | my changes. The page was showing up fine before adding the input
> element.
> | > |
> | > | Is there a way to avoid getting the “Page has ExpiredÃ
> ¢â‚?message?
> | > |
> | > | Thank you,
> | > |
> | > |
> | >
> | >
> |
>
>[/color]

Steven Cheng[MSFT]'s Avatar
Steven Cheng[MSFT]
Guest
n/a Posts
November 19th, 2005
05:10 PM
#6

Re: Page has Expired - using html input control (type=file)
Thanks for the response Nathan,

Yes, I did follow the squence you mentioned and I know that click another
postback button is the important thing becaue this cause the former record
in the browser's history contains posted form data. However, as I mentioned
earilier, by default there should not occur "Page expired ...." message. If
you think necessary I can attached a simple project which contains a page
and the global file which run without the problem on my side so that you
can test on your side.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| Thread-Topic: Page has Expired - using html input control (type=file)
| thread-index: AcWk46GMpp9AjOzcRoC0iZ8I7zV7nQ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
<COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
<89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
<UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: Page has Expired - using html input control (type=file)
| Date: Fri, 19 Aug 2005 10:30:02 -0700
| Lines: 228
| Message-ID: <7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:119160
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks Steven,
|
| We are using the default settings for the page expiration on the IIS
(check
| box cleared). In order to get the error you have to have ‘
runat=server?set
| for the input control. You also have to first click on the Button1 to do
a
| postback and then Button2 to throw the exception (the order of clicking
the
| buttons is important to create the error).
|
| "Steven Cheng[MSFT]" wrote:
|
| > Thanks for your response Nathan,
| >
| > As for the behavior you mentioned, it is likely due to browser's
history
| > behavior for handling post submit history. When we put input entry
fields
| > on page and hit submit , this request contains forms data ,and when we
hit
| > back button, the browser may prevent the content from displaying .
| > However, by default this should not happen since based on my local
| > test(through the steps you provided) , I didn't ecounter the "page
| > expired..." warning message. I'm thinking whether your webserver has
| > configured some certain http header which cause the behavior. Have you
| > checked your IIS server to see whether there are any http headers
| > configured in the site or virtual dir setting?
| >
| > Also, you can test on some other server to see whether you also get
this
| > behavior. To test this, we can simply create a page which has a text
field
| > and a submit button. After submit the page through the submit button ,
hit
| > the "back" button on browser to see whether you can correctly get the
| > previous view of the page.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: Page has Expired - using html input control (type=file)
| > | thread-index: AcWkJWm3DrbB0rf3RnWcVkmF7Y1jcQ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| > | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
| > <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
| > | Subject: RE: Page has Expired - using html input control (type=file)
| > | Date: Thu, 18 Aug 2005 11:48:26 -0700
| > | Lines: 131
| > | Message-ID: <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 8bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:118964
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Yes. It used to work fine and I was able to see the page, but once I
| > added
| > | the html input tag to my page I start getting the Page has Expired
| > message.
| > |
| > | We don’t have any expiration set for the client side pages. I
tested my
| > page
| > | on Netscape 7.2 and it works fine (I don’t get the Page
Expired).
| > |
| > | Here is a sample setup to recreate this problem:
| > | 1- Create a web application
| > | 2- In WebForm1.aspx add three controls
| > | <asp:Button id="Button1" runat="server"
| > | Text="Button1"></asp:Button>
| > | <INPUT type="file" id="cFile" runat="server">
| > | <asp:Button id="Button2" runat="server"
| > | Text="Button2"></asp:Button>
| > | 3- Update the Global.asax
| > | protected void Application_Error(Object sender, EventArgs e)
| > | {
| > | Response.Clear();
| > | Exception objErr =
| > Server.GetLastError().GetBaseException();
| > | Session["MyErr"] = objErr.Message.ToString();
| > | Server.ClearError();
| > | Response.Write("<SCRIPT
| > | language='javascript'>history.go(-1);
| > |
| >
window.open('http://www.msn.ca','PopUp','scrollbars=yes,width=500,heig ht=400
| > ');</SCRIPT>");
| > | }
| > | 4- For each one of the Buttons create an onclick event handler
| > | 5- In the onclick event of Button2 put the following line of code
| > | throw new Exception("My exception");
| > | 6- Run the application
| > | 7- First click button1 and then click button2, you should see the
Page
| > has
| > | Expired message
| > |
| > | Note: If you remove the INPUT control (or remove the runat=server
from
| > INPUT
| > | control) the error won't happen.
| > |
| > |
| > |
| > | "Steven Cheng[MSFT]" wrote:
| > |
| > | > Hi Nathan,
| > | >
| > | > Welcome to ASPNET newsgroup.
| > | > From your description, you're redireting the current user to a
custom
| > error
| > | > page and make the main window display the previous page when there
| > occurs
| > | > unhandled exceptio in the asp.net app. However, you're always
gettting
| > the
| > | > "page has Expired ..." message,yes?
| > | >
| > | > As for the "Page has expired..." message, it is populated by the
| > clientside
| > | > browser when the browser find a certain page record's clientside
cache
| > has
| > | > expired or event haven't been cached at clientside. So what's the
page
| > | > you're gong to navigate back through the history.go(-1); ? If it's
the
| > | > pages in the same web application, then have they been set some
| > expiration
| > | > policy which makes them expired immediately (not cached ) at client
| > side?
| > | > Or have you tested visting the application from some other clients
to
| > see
| > | > whether all the clients will have the same behavior so as to make
sure
| > this
| > | > is not a clientside browsr setting issue.
| > | >
| > | > Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | Thread-Topic: Page has Expired - using html input control
(type=file)
| > | > | thread-index: AcWjgRNz1ihCOTGJT5CTuex0V4sWFg==
| > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| > | > | Subject: Page has Expired - using html input control (type=file)
| > | > | Date: Wed, 17 Aug 2005 16:12:02 -0700
| > | > | Lines: 27
| > | > | Message-ID: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain;
| > | > | charset="Utf-8"
| > | > | Content-Transfer-Encoding: 8bit
| > | > | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | Content-Class: urn:content-classes:message
| > | > | Importance: normal
| > | > | Priority: normal
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | Path:
| > TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA01.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:118762
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | I have an aspx page with a data grid, some textboxes, and an
update
| > | > button.
| > | > | This page also has one html input element with type=file (not
inside
| > the
| > | > data
| > | > | grid and runat=server).
| > | > |
| > | > | The update button will verify the information that has been
entered
| > and
| > | > | updates the data base if the data is correct. Update will throw
an
| > | > exception
| > | > | if the data is not validate based on some given rules. I also
have a
| > | > custom
| > | > | error handling page to show the exceptions (following lines).
| > | > |
| > | > | protected void Application_Error(Object sender, EventArgs e)
| > | > | {
| > | > | Exception ex = Server.GetLastError().GetBaseException();
| > | > | Session["MyErr"] = ex.Message.ToString();
| > | > | Server.ClearError();
| > | > | Response.Write("<script
language='javascript'>history.go(-1);
| > | > |
| > | >
| >
window.open('MyErrorPage.aspx','Error','scrollbars =yes,width=500,height=120'
| > | > );</script>");
| > | > | }
| > | > |
| > | > | My problem is that when I get the exception on my aspx page
| > (generated by
| > | > | the update) and try to go to my previous page (history.go(-1)) I
get
| > the
| > | > | “Warning: Page has Expiredââ?message and
when I refresh the
| > page I
| > | > loose all
| > | > | my changes. The page was showing up fine before adding the input
| > element.
| > | > |
| > | > | Is there a way to avoid getting the “Page has
ExpiredÃ
| > ¢â?message?
| > | > |
| > | > | Thank you,
| > | > |
| > | > |
| > | >
| > | >
| > |
| >
| >
|


Nathan's Avatar
Nathan
Guest
n/a Posts
November 19th, 2005
05:12 PM
#7

Re: Page has Expired - using html input control (type=file)
Thanks Steven,

Yes, please attach the simple project and instruction, then we can test.

Regards

"Steven Cheng[MSFT]" wrote:
[color=blue]
> Thanks for the response Nathan,
>
> Yes, I did follow the squence you mentioned and I know that click another
> postback button is the important thing becaue this cause the former record
> in the browser's history contains posted form data. However, as I mentioned
> earilier, by default there should not occur "Page expired ...." message. If
> you think necessary I can attached a simple project which contains a page
> and the global file which run without the problem on my side so that you
> can test on your side.
>
> Thanks,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> --------------------
> | Thread-Topic: Page has Expired - using html input control (type=file)
> | thread-index: AcWk46GMpp9AjOzcRoC0iZ8I7zV7nQ==
> | X-WBNR-Posting-Host: 209.17.159.193
> | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
> <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
> <UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
> | Subject: RE: Page has Expired - using html input control (type=file)
> | Date: Fri, 19 Aug 2005 10:30:02 -0700
> | Lines: 228
> | Message-ID: <7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 8bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:119160
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | Thanks Steven,
> |
> | We are using the default settings for the page expiration on the IIS
> (check
> | box cleared). In order to get the error you have to have ‘
> runat=server�set
> | for the input control. You also have to first click on the Button1 to do
> a
> | postback and then Button2 to throw the exception (the order of clicking
> the
> | buttons is important to create the error).
> |
> | "Steven Cheng[MSFT]" wrote:
> |
> | > Thanks for your response Nathan,
> | >
> | > As for the behavior you mentioned, it is likely due to browser's
> history
> | > behavior for handling post submit history. When we put input entry
> fields
> | > on page and hit submit , this request contains forms data ,and when we
> hit
> | > back button, the browser may prevent the content from displaying .
> | > However, by default this should not happen since based on my local
> | > test(through the steps you provided) , I didn't ecounter the "page
> | > expired..." warning message. I'm thinking whether your webserver has
> | > configured some certain http header which cause the behavior. Have you
> | > checked your IIS server to see whether there are any http headers
> | > configured in the site or virtual dir setting?
> | >
> | > Also, you can test on some other server to see whether you also get
> this
> | > behavior. To test this, we can simply create a page which has a text
> field
> | > and a submit button. After submit the page through the submit button ,
> hit
> | > the "back" button on browser to see whether you can correctly get the
> | > previous view of the page.
> | >
> | > Thanks,
> | >
> | > Steven Cheng
> | > Microsoft Online Support
> | >
> | > Get Secure! www.microsoft.com/security
> | > (This posting is provided "AS IS", with no warranties, and confers no
> | > rights.)
> | >
> | >
> | >
> | >
> | > --------------------
> | > | Thread-Topic: Page has Expired - using html input control (type=file)
> | > | thread-index: AcWkJWm3DrbB0rf3RnWcVkmF7Y1jcQ==
> | > | X-WBNR-Posting-Host: 209.17.159.193
> | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | > | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> | > <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
> | > | Subject: RE: Page has Expired - using html input control (type=file)
> | > | Date: Thu, 18 Aug 2005 11:48:26 -0700
> | > | Lines: 131
> | > | Message-ID: <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
> | > | MIME-Version: 1.0
> | > | Content-Type: text/plain;
> | > | charset="Utf-8"
> | > | Content-Transfer-Encoding: 8bit
> | > | X-Newsreader: Microsoft CDO for Windows 2000
> | > | Content-Class: urn:content-classes:message
> | > | Importance: normal
> | > | Priority: normal
> | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | > | Xref: TK2MSFTNGXA01.phx.gbl
> | > microsoft.public.dotnet.framework.aspnet:118964
> | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> | > |
> | > | Yes. It used to work fine and I was able to see the page, but once I
> | > added
> | > | the html input tag to my page I start getting the Page has Expired
> | > message.
> | > |
> | > | We don’t have any expiration set for the client side pages. I
> tested my
> | > page
> | > | on Netscape 7.2 and it works fine (I don’t get the Page
> Expired).
> | > |
> | > | Here is a sample setup to recreate this problem:
> | > | 1- Create a web application
> | > | 2- In WebForm1.aspx add three controls
> | > | <asp:Button id="Button1" runat="server"
> | > | Text="Button1"></asp:Button>
> | > | <INPUT type="file" id="cFile" runat="server">
> | > | <asp:Button id="Button2" runat="server"
> | > | Text="Button2"></asp:Button>
> | > | 3- Update the Global.asax
> | > | protected void Application_Error(Object sender, EventArgs e)
> | > | {
> | > | Response.Clear();
> | > | Exception objErr =
> | > Server.GetLastError().GetBaseException();
> | > | Session["MyErr"] = objErr.Message.ToString();
> | > | Server.ClearError();
> | > | Response.Write("<SCRIPT
> | > | language='javascript'>history.go(-1);
> | > |
> | >
> window.open('http://www.msn.ca','PopUp','scrollbars=yes,width=500,heig ht=400
> | > ');</SCRIPT>");
> | > | }
> | > | 4- For each one of the Buttons create an onclick event handler
> | > | 5- In the onclick event of Button2 put the following line of code
> | > | throw new Exception("My exception");
> | > | 6- Run the application
> | > | 7- First click button1 and then click button2, you should see the
> Page
> | > has
> | > | Expired message
> | > |
> | > | Note: If you remove the INPUT control (or remove the runat=server
> from
> | > INPUT
> | > | control) the error won't happen.
> | > |
> | > |
> | > |
> | > | "Steven Cheng[MSFT]" wrote:
> | > |
> | > | > Hi Nathan,
> | > | >
> | > | > Welcome to ASPNET newsgroup.
> | > | > From your description, you're redireting the current user to a
> custom
> | > error
> | > | > page and make the main window display the previous page when there
> | > occurs
> | > | > unhandled exceptio in the asp.net app. However, you're always
> gettting
> | > the
> | > | > "page has Expired ..." message,yes?
> | > | >
> | > | > As for the "Page has expired..." message, it is populated by the
> | > clientside
> | > | > browser when the browser find a certain page record's clientside
> cache
> | > has
> | > | > expired or event haven't been cached at clientside. So what's the
> page
> | > | > you're gong to navigate back through the history.go(-1); ? If it's
> the
> | > | > pages in the same web application, then have they been set some
> | > expiration
> | > | > policy which makes them expired immediately (not cached ) at client
> | > side?
> | > | > Or have you tested visting the application from some other clients
> to
> | > see
> | > | > whether all the clients will have the same behavior so as to make
> sure
> | > this
> | > | > is not a clientside browsr setting issue.
> | > | >
> | > | > Thanks,
> | > | >
> | > | > Steven Cheng
> | > | > Microsoft Online Support
> | > | >
> | > | > Get Secure! www.microsoft.com/security
> | > | > (This posting is provided "AS IS", with no warranties, and confers
> no
> | > | > rights.)
> | > | >
> | > | >
> | > | >
> | > | >
> | > | > --------------------
> | > | > | Thread-Topic: Page has Expired - using html input control
> (type=file)
> | > | > | thread-index: AcWjgRNz1ihCOTGJT5CTuex0V4sWFg==
> | > | > | X-WBNR-Posting-Host: 209.17.159.193
> | > | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | > | > | Subject: Page has Expired - using html input control (type=file)
> | > | > | Date: Wed, 17 Aug 2005 16:12:02 -0700
> | > | > | Lines: 27
> | > | > | Message-ID: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> | > | > | MIME-Version: 1.0
> | > | > | Content-Type: text/plain;
> | > | > | charset="Utf-8"
> | > | > | Content-Transfer-Encoding: 8bit
> | > | > | X-Newsreader: Microsoft CDO for Windows 2000
> | > | > | Content-Class: urn:content-classes:message
> | > | > | Importance: normal
> | > | > | Priority: normal
> | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | > | > | Path:
> | > TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
> | > | > | Xref: TK2MSFTNGXA01.phx.gbl
> | > | > microsoft.public.dotnet.framework.aspnet:118762
> | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> | > | > |
> | > | > | I have an aspx page with a data grid, some textboxes, and an
> update
> | > | > button.
> | > | > | This page also has one html input element with type=file (not
> inside
> | > the
> | > | > data
> | > | > | grid and runat=server).
> | > | > |
> | > | > | The update button will verify the information that has been
> entered
> | > and
> | > | > | updates the data base if the data is correct. Update will throw
> an
> | > | > exception
> | > | > | if the data is not validate based on some given rules. I also
> have a
> | > | > custom
> | > | > | error handling page to show the exceptions (following lines).
> | > | > |
> | > | > | protected void Application_Error(Object sender, EventArgs e)
> | > | > | {
> | > | > | Exception ex = Server.GetLastError().GetBaseException();
> | > | > | Session["MyErr"] = ex.Message.ToString();
> | > | > | Server.ClearError();
> | > | > | Response.Write("<script
> language='javascript'>history.go(-1);
> | > | > |
> | > | >
> | >
> window.open('MyErrorPage.aspx','Error','scrollbars =yes,width=500,height=120'
> | > | > );</script>");
> | > | > | }
> | > | > |
> | > | > | My problem is that when I get the exception on my aspx page
> | > (generated by
> | > | > | the update) and try to go to my previous page (history.go(-1)) I
> get
> | > the
> | > | > | “Warning: Page has Expiredââ�message and
> when I refresh the
> | > page I
> | > | > loose all
> | > | > | my changes. The page was showing up fine before adding the input
> | > element.
> | > | > |
> | > | > | Is there a way to avoid getting the “Page has
> ExpiredÃ[/color]

Nathan's Avatar
Nathan
Guest
n/a Posts
November 19th, 2005
05:17 PM
#8

Re: Page has Expired - using html input control (type=file)
In order to get the error you need to use an input tag with type=file.
Without using that control we don’t have any problem, as soon as we add that
control we start getting the Page Expired error. On your sample program
please change one of the TextBox controls to the following:

<input id="File1" type="file" runat="server">

And try again.


"Steven Cheng[MSFT]" wrote:
[color=blue]
> Hi Nathan,
>
> I've attached my test project in this message. You can get it through OE to
> download the attached zip file.
>
> Thanks,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> --------------------
> | Thread-Topic: Page has Expired - using html input control (type=file)
> | thread-index: AcWnNnmpyUVC8RK8TrGwPGPd2vVDlw==
> | X-WBNR-Posting-Host: 209.17.159.193
> | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
> <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
> <UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
> <7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
> <TTZ04#vpFHA.944@TK2MSFTNGXA01.phx.gbl>
> | Subject: RE: Page has Expired - using html input control (type=file)
> | Date: Mon, 22 Aug 2005 09:28:06 -0700
> | Lines: 308
> | Message-ID: <760A6AD5-F25E-4042-99AE-788815208CBF@microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 8bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:119513
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | Thanks Steven,
> |
> | Yes, please attach the simple project and instruction, then we can test.
> |
> | Regards
> |
> | "Steven Cheng[MSFT]" wrote:
> |
> | > Thanks for the response Nathan,
> | >
> | > Yes, I did follow the squence you mentioned and I know that click
> another
> | > postback button is the important thing becaue this cause the former
> record
> | > in the browser's history contains posted form data. However, as I
> mentioned
> | > earilier, by default there should not occur "Page expired ...."
> message. If
> | > you think necessary I can attached a simple project which contains a
> page
> | > and the global file which run without the problem on my side so that
> you
> | > can test on your side.
> | >
> | > Thanks,
> | >
> | > Steven Cheng
> | > Microsoft Online Support
> | >
> | > Get Secure! www.microsoft.com/security
> | > (This posting is provided "AS IS", with no warranties, and confers no
> | > rights.)
> | >
> | > --------------------
> | > | Thread-Topic: Page has Expired - using html input control (type=file)
> | > | thread-index: AcWk46GMpp9AjOzcRoC0iZ8I7zV7nQ==
> | > | X-WBNR-Posting-Host: 209.17.159.193
> | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | > | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> | > <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
> | > <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
> | > <UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
> | > | Subject: RE: Page has Expired - using html input control (type=file)
> | > | Date: Fri, 19 Aug 2005 10:30:02 -0700
> | > | Lines: 228
> | > | Message-ID: <7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
> | > | MIME-Version: 1.0
> | > | Content-Type: text/plain;
> | > | charset="Utf-8"
> | > | Content-Transfer-Encoding: 8bit
> | > | X-Newsreader: Microsoft CDO for Windows 2000
> | > | Content-Class: urn:content-classes:message
> | > | Importance: normal
> | > | Priority: normal
> | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | > | Xref: TK2MSFTNGXA01.phx.gbl
> | > microsoft.public.dotnet.framework.aspnet:119160
> | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> | > |
> | > | Thanks Steven,
> | > |
> | > | We are using the default settings for the page expiration on the IIS
> | > (check
> | > | box cleared). In order to get the error you have to have â€Ë?[color=green]
> > runat=serverâ�set[/color]
> | > | for the input control. You also have to first click on the Button1 to
> do
> | > a
> | > | postback and then Button2 to throw the exception (the order of
> clicking
> | > the
> | > | buttons is important to create the error).
> | > |
> | > | "Steven Cheng[MSFT]" wrote:
> | > |
> | > | > Thanks for your response Nathan,
> | > | >
> | > | > As for the behavior you mentioned, it is likely due to browser's
> | > history
> | > | > behavior for handling post submit history. When we put input entry
> | > fields
> | > | > on page and hit submit , this request contains forms data ,and when
> we
> | > hit
> | > | > back button, the browser may prevent the content from displaying .
> | > | > However, by default this should not happen since based on my local
> | > | > test(through the steps you provided) , I didn't ecounter the "page
> | > | > expired..." warning message. I'm thinking whether your webserver
> has
> | > | > configured some certain http header which cause the behavior. Have
> you
> | > | > checked your IIS server to see whether there are any http headers
> | > | > configured in the site or virtual dir setting?
> | > | >
> | > | > Also, you can test on some other server to see whether you also get
> | > this
> | > | > behavior. To test this, we can simply create a page which has a
> text
> | > field
> | > | > and a submit button. After submit the page through the submit
> button ,
> | > hit
> | > | > the "back" button on browser to see whether you can correctly get
> the
> | > | > previous view of the page.
> | > | >
> | > | > Thanks,
> | > | >
> | > | > Steven Cheng
> | > | > Microsoft Online Support
> | > | >
> | > | > Get Secure! www.microsoft.com/security
> | > | > (This posting is provided "AS IS", with no warranties, and confers
> no
> | > | > rights.)
> | > | >
> | > | >
> | > | >
> | > | >
> | > | > --------------------
> | > | > | Thread-Topic: Page has Expired - using html input control
> (type=file)
> | > | > | thread-index: AcWkJWm3DrbB0rf3RnWcVkmF7Y1jcQ==
> | > | > | X-WBNR-Posting-Host: 209.17.159.193
> | > | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | > | > | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> | > | > <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
> | > | > | Subject: RE: Page has Expired - using html input control
> (type=file)
> | > | > | Date: Thu, 18 Aug 2005 11:48:26 -0700
> | > | > | Lines: 131
> | > | > | Message-ID: <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
> | > | > | MIME-Version: 1.0
> | > | > | Content-Type: text/plain;
> | > | > | charset="Utf-8"
> | > | > | Content-Transfer-Encoding: 8bit
> | > | > | X-Newsreader: Microsoft CDO for Windows 2000
> | > | > | Content-Class: urn:content-classes:message
> | > | > | Importance: normal
> | > | > | Priority: normal
> | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | > | > | Xref: TK2MSFTNGXA01.phx.gbl
> | > | > microsoft.public.dotnet.framework.aspnet:118964
> | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> | > | > |
> | > | > | Yes. It used to work fine and I was able to see the page, but
> once I
> | > | > added
> | > | > | the html input tag to my page I start getting the Page has
> Expired
> | > | > message.
> | > | > |
> | > | > | We don’t have any expiration set for the client
> side pages. I
> | > tested my
> | > | > page
> | > | > | on Netscape 7.2 and it works fine (I don’t get
> the Page
> | > Expired).
> | > | > |
> | > | > | Here is a sample setup to recreate this problem:
> | > | > | 1- Create a web application
> | > | > | 2- In WebForm1.aspx add three controls
> | > | > | <asp:Button id="Button1" runat="server"
> | > | > | Text="Button1"></asp:Button>
> | > | > | <INPUT type="file" id="cFile" runat="server">
> | > | > | <asp:Button id="Button2" runat="server"
> | > | > | Text="Button2"></asp:Button>
> | > | > | 3- Update the Global.asax
> | > | > | protected void Application_Error(Object sender,
> EventArgs e)
> | > | > | {
> | > | > | Response.Clear();
> | > | > | Exception objErr =
> | > | > Server.GetLastError().GetBaseException();
> | > | > | Session["MyErr"] = objErr.Message.ToString();
> | > | > | Server.ClearError();
> | > | > | Response.Write("<SCRIPT
> | > | > | language='javascript'>history.go(-1);
> | > | > |
> | > | >
> | >
> window.open('http://www.msn.ca','PopUp','scrollbars=yes,width=500,heig ht=400
> | > | > ');</SCRIPT>");
> | > | > | }
> | > | > | 4- For each one of the Buttons create an onclick event handler
> | > | > | 5- In the onclick event of Button2 put the following line of code
> | > | > | throw new Exception("My exception");
> | > | > | 6- Run the application
> | > | > | 7- First click button1 and then click button2, you should see the
> | > Page
> | > | > has
> | > | > | Expired message
> | > | > |
> | > | > | Note: If you remove the INPUT control (or remove the runat=server
> | > from
> | > | > INPUT
> | > | > | control) the error won't happen.
> | > | > |
> | > | > |
> | > | > |
> | > | > | "Steven Cheng[MSFT]" wrote:
> | > | > |
> | > | > | > Hi Nathan,
> | > | > | >
> | > | > | > Welcome to ASPNET newsgroup.
> | > | > | > From your description, you're redireting the current user to a
> | > custom
> | > | > error
> | > | > | > page and make the main window display the previous page when
> there
> | > | > occurs
> | > | > | > unhandled exceptio in the asp.net app. However, you're always
> | > gettting
> | > | > the
> | > | > | > "page has Expired ..." message,yes?
> | > | > | >
> | > | > | > As for the "Page has expired..." message, it is populated by
> the
> | > | > clientside
> | > | > | > browser when the browser find a certain page record's
> clientside
> | > cache
> | > | > has
> | > | > | > expired or event haven't been cached at clientside. So what's
> the
> | > page
> | > | > | > you're gong to navigate back through the history.go(-1); ? If
> it's
> | > the
> | > | > | > pages in the same web application, then have they been set some
> | > | > expiration
> | > | > | > policy which makes them expired immediately (not cached ) at
> client
> | > | > side?
> | > | > | > Or have you tested visting the application from some other
> clients
> | > to
> | > | > see
> | > | > | > whether all the clients will have the same behavior so as to
> make
> | > sure
> | > | > this
> | > | > | > is not a clientside browsr setting issue.
> | > | > | >
> | > | > | > Thanks,
> | > | > | >
> | > | > | > Steven Cheng
> | > | > | > Microsoft Online Support
> | > | > | >[/color]

Steven Cheng[MSFT]'s Avatar
Steven Cheng[MSFT]
Guest
n/a Posts
November 19th, 2005
05:18 PM
#9

Re: Page has Expired - using html input control (type=file)
Thanks for your further followup Nathan,

Yes, you're right, I missed the type="file" in your former message. I did
got the "Page Page has Expired ..." error,also some times get "page can not
display ..." message. Based on some further research , this behavior do
caused by the IE browser which block the former history (post version) .
When there're input file field on the page, and we submit a post request,
the IE browser won't allow the previous view display again from cache.
Currently I haven't found any certain configuration in the IE browser, for
an alertnative approach, we may consider use response.redirect to locate
the user to
the same page as the error occured rather than use the history back
script.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: Page has Expired - using html input control (type=file)
| thread-index: AcWoP8Lxhq4lmukHTK2jsgCG5P6scw==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
<COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
<89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
<UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
<7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
<TTZ04#vpFHA.944@TK2MSFTNGXA01.phx.gbl>
<760A6AD5-F25E-4042-99AE-788815208CBF@microsoft.com>
<bNB6eQ8pFHA.1204@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: Page has Expired - using html input control (type=file)
| Date: Tue, 23 Aug 2005 17:07:05 -0700
| Lines: 312
| Message-ID: <F5498385-9A84-443C-B3A3-1E04E8DA10FF@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:119846
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| In order to get the error you need to use an input tag with type=file.
| Without using that control we don’t have any problem, as soon as we add
that
| control we start getting the Page Expired error. On your sample program
| please change one of the TextBox controls to the following:
|
| <input id="File1" type="file" runat="server">
|
| And try again.
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Nathan,
| >
| > I've attached my test project in this message. You can get it through
OE to
| > download the attached zip file.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | Thread-Topic: Page has Expired - using html input control (type=file)
| > | thread-index: AcWnNnmpyUVC8RK8TrGwPGPd2vVDlw==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| > | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
| > <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
| > <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
| > <UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
| > <7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
| > <TTZ04#vpFHA.944@TK2MSFTNGXA01.phx.gbl>
| > | Subject: RE: Page has Expired - using html input control (type=file)
| > | Date: Mon, 22 Aug 2005 09:28:06 -0700
| > | Lines: 308
| > | Message-ID: <760A6AD5-F25E-4042-99AE-788815208CBF@microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 8bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:119513
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Thanks Steven,
| > |
| > | Yes, please attach the simple project and instruction, then we can
test.
| > |
| > | Regards
| > |
| > | "Steven Cheng[MSFT]" wrote:
| > |
| > | > Thanks for the response Nathan,
| > | >
| > | > Yes, I did follow the squence you mentioned and I know that click
| > another
| > | > postback button is the important thing becaue this cause the former
| > record
| > | > in the browser's history contains posted form data. However, as I
| > mentioned
| > | > earilier, by default there should not occur "Page expired ...."
| > message. If
| > | > you think necessary I can attached a simple project which contains
a
| > page
| > | > and the global file which run without the problem on my side so
that
| > you
| > | > can test on your side.
| > | >
| > | > Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | > --------------------
| > | > | Thread-Topic: Page has Expired - using html input control
(type=file)
| > | > | thread-index: AcWk46GMpp9AjOzcRoC0iZ8I7zV7nQ==
| > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| > | > | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
| > | > <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
| > | > <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
| > | > <UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
| > | > | Subject: RE: Page has Expired - using html input control
(type=file)
| > | > | Date: Fri, 19 Aug 2005 10:30:02 -0700
| > | > | Lines: 228
| > | > | Message-ID: <7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain;
| > | > | charset="Utf-8"
| > | > | Content-Transfer-Encoding: 8bit
| > | > | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | Content-Class: urn:content-classes:message
| > | > | Importance: normal
| > | > | Priority: normal
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA01.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:119160
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | Thanks Steven,
| > | > |
| > | > | We are using the default settings for the page expiration on the
IIS
| > | > (check
| > | > | box cleared). In order to get the error you have to have â
‚¬?
| > > runat=serverââ?set
| > | > | for the input control. You also have to first click on the
Button1 to
| > do
| > | > a
| > | > | postback and then Button2 to throw the exception (the order of
| > clicking
| > | > the
| > | > | buttons is important to create the error).
| > | > |
| > | > | "Steven Cheng[MSFT]" wrote:
| > | > |
| > | > | > Thanks for your response Nathan,
| > | > | >
| > | > | > As for the behavior you mentioned, it is likely due to
browser's
| > | > history
| > | > | > behavior for handling post submit history. When we put input
entry
| > | > fields
| > | > | > on page and hit submit , this request contains forms data ,and
when
| > we
| > | > hit
| > | > | > back button, the browser may prevent the content from
displaying .
| > | > | > However, by default this should not happen since based on my
local
| > | > | > test(through the steps you provided) , I didn't ecounter the
"page
| > | > | > expired..." warning message. I'm thinking whether your
webserver
| > has
| > | > | > configured some certain http header which cause the behavior.
Have
| > you
| > | > | > checked your IIS server to see whether there are any http
headers
| > | > | > configured in the site or virtual dir setting?
| > | > | >
| > | > | > Also, you can test on some other server to see whether you also
get
| > | > this
| > | > | > behavior. To test this, we can simply create a page which has a
| > text
| > | > field
| > | > | > and a submit button. After submit the page through the submit
| > button ,
| > | > hit
| > | > | > the "back" button on browser to see whether you can correctly
get
| > the
| > | > | > previous view of the page.
| > | > | >
| > | > | > Thanks,
| > | > | >
| > | > | > Steven Cheng
| > | > | > Microsoft Online Support
| > | > | >
| > | > | > Get Secure! www.microsoft.com/security
| > | > | > (This posting is provided "AS IS", with no warranties, and
confers
| > no
| > | > | > rights.)
| > | > | >
| > | > | >
| > | > | >
| > | > | >
| > | > | > --------------------
| > | > | > | Thread-Topic: Page has Expired - using html input control
| > (type=file)
| > | > | > | thread-index: AcWkJWm3DrbB0rf3RnWcVkmF7Y1jcQ==
| > | > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
| > | > | > | References:
<03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
| > | > | > <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
| > | > | > | Subject: RE: Page has Expired - using html input control
| > (type=file)
| > | > | > | Date: Thu, 18 Aug 2005 11:48:26 -0700
| > | > | > | Lines: 131
| > | > | > | Message-ID:
<89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
| > | > | > | MIME-Version: 1.0
| > | > | > | Content-Type: text/plain;
| > | > | > | charset="Utf-8"
| > | > | > | Content-Transfer-Encoding: 8bit
| > | > | > | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | > | Content-Class: urn:content-classes:message
| > | > | > | Importance: normal
| > | > | > | Priority: normal
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | > | > | Xref: TK2MSFTNGXA01.phx.gbl
| > | > | > microsoft.public.dotnet.framework.aspnet:118964
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > | > |
| > | > | > | Yes. It used to work fine and I was able to see the page, but
| > once I
| > | > | > added
| > | > | > | the html input tag to my page I start getting the Page has
| > Expired
| > | > | > message.
| > | > | > |
| > | > | > | We don’t have any
expiration set for the client
| > side pages. I
| > | > tested my
| > | > | > page
| > | > | > | on Netscape 7.2 and it works fine (I donââ‚
¬Ã¢â€žÂ¢t get
| > the Page
| > | > Expired).
| > | > | > |
| > | > | > | Here is a sample setup to recreate this problem:
| > | > | > | 1- Create a web application
| > | > | > | 2- In WebForm1.aspx add three controls
| > | > | > | <asp:Button id="Button1" runat="server"
| > | > | > | Text="Button1"></asp:Button>
| > | > | > | <INPUT type="file" id="cFile" runat="server">
| > | > | > | <asp:Button id="Button2" runat="server"
| > | > | > | Text="Button2"></asp:Button>
| > | > | > | 3- Update the Global.asax
| > | > | > | protected void Application_Error(Object sender,
| > EventArgs e)
| > | > | > | {
| > | > | > | Response.Clear();
| > | > | > | Exception objErr =
| > | > | > Server.GetLastError().GetBaseException();
| > | > | > | Session["MyErr"] = objErr.Message.ToString();
| > | > | > | Server.ClearError();
| > | > | > | Response.Write("<SCRIPT
| > | > | > | language='javascript'>history.go(-1);
| > | > | > |
| > | > | >
| > | >
| >
window.open('http://www.msn.ca','PopUp','scrollbars=yes,width=500,heig ht=400
| > | > | > ');</SCRIPT>");
| > | > | > | }
| > | > | > | 4- For each one of the Buttons create an onclick event handler
| > | > | > | 5- In the onclick event of Button2 put the following line of
code
| > | > | > | throw new Exception("My exception");

| > | > | > | 6- Run the application
| > | > | > | 7- First click button1 and then click button2, you should see
the
| > | > Page
| > | > | > has
| > | > | > | Expired message
| > | > | > |
| > | > | > | Note: If you remove the INPUT control (or remove the
runat=server
| > | > from
| > | > | > INPUT
| > | > | > | control) the error won't happen.
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | > | "Steven Cheng[MSFT]" wrote:
| > | > | > |
| > | > | > | > Hi Nathan,
| > | > | > | >
| > | > | > | > Welcome to ASPNET newsgroup.
| > | > | > | > From your description, you're redireting the current user
to a
| > | > custom
| > | > | > error
| > | > | > | > page and make the main window display the previous page
when
| > there
| > | > | > occurs
| > | > | > | > unhandled exceptio in the asp.net app. However, you're
always
| > | > gettting
| > | > | > the
| > | > | > | > "page has Expired ..." message,yes?
| > | > | > | >
| > | > | > | > As for the "Page has expired..." message, it is populated
by
| > the
| > | > | > clientside
| > | > | > | > browser when the browser find a certain page record's
| > clientside
| > | > cache
| > | > | > has
| > | > | > | > expired or event haven't been cached at clientside. So
what's
| > the
| > | > page
| > | > | > | > you're gong to navigate back through the history.go(-1); ?
If
| > it's
| > | > the
| > | > | > | > pages in the same web application, then have they been set
some
| > | > | > expiration
| > | > | > | > policy which makes them expired immediately (not cached )
at
| > client
| > | > | > side?
| > | > | > | > Or have you tested visting the application from some other
| > clients
| > | > to
| > | > | > see
| > | > | > | > whether all the clients will have the same behavior so as
to
| > make
| > | > sure
| > | > | > this
| > | > | > | > is not a clientside browsr setting issue.
| > | > | > | >
| > | > | > | > Thanks,
| > | > | > | >
| > | > | > | > Steven Cheng
| > | > | > | > Microsoft Online Support
| > | > | > | >
|


Nathan's Avatar
Nathan
Guest
n/a Posts
November 19th, 2005
05:22 PM
#10

Re: Page has Expired - using html input control (type=file)
We can not use Response.Redirect because we will lose the user input on the
page. Any work around or fix? We need to deliver a project pretty soon!

"Steven Cheng[MSFT]" wrote:
[color=blue]
> Thanks for your further followup Nathan,
>
> Yes, you're right, I missed the type="file" in your former message. I did
> got the "Page Page has Expired ..." error,also some times get "page can not
> display ..." message. Based on some further research , this behavior do
> caused by the IE browser which block the former history (post version) .
> When there're input file field on the page, and we submit a post request,
> the IE browser won't allow the previous view display again from cache.
> Currently I haven't found any certain configuration in the IE browser, for
> an alertnative approach, we may consider use response.redirect to locate
> the user to
> the same page as the error occured rather than use the history back
> script.
>
> Thanks,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
> --------------------
> | Thread-Topic: Page has Expired - using html input control (type=file)
> | thread-index: AcWoP8Lxhq4lmukHTK2jsgCG5P6scw==
> | X-WBNR-Posting-Host: 209.17.159.193
> | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE6132@microsoft.com>
> <COJFsb8oFHA.3472@TK2MSFTNGXA01.phx.gbl>
> <89E58E29-E699-4CE2-8E63-CACA6C6B4116@microsoft.com>
> <UszjP#GpFHA.2700@TK2MSFTNGXA01.phx.gbl>
> <7E8809AA-1F95-448D-9861-975C58059D96@microsoft.com>
> <TTZ04#vpFHA.944@TK2MSFTNGXA01.phx.gbl>
> <760A6AD5-F25E-4042-99AE-788815208CBF@microsoft.com>
> <bNB6eQ8pFHA.1204@TK2MSFTNGXA01.phx.gbl>
> | Subject: RE: Page has Expired - using html input control (type=file)
> | Date: Tue, 23 Aug 2005 17:07:05 -0700
> | Lines: 312
> | Message-ID: <F5498385-9A84-443C-B3A3-1E04E8DA10FF@microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 8bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet:119846
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | In order to get the error you need to use an input tag with type=file.
> | Without using that control we don’t have any problem, as soon as we add
> that
> | control we start getting the Page Expired error. On your sample program
> | please change one of the TextBox controls to the following:
> |
> | <input id="File1" type="file" runat="server">
> |
> | And try again.
> |
> |
> | "Steven Cheng[MSFT]" wrote:
> |
> | > Hi Nathan,
> | >
> | > I've attached my test project in this message. You can get it through
> OE to
> | > download the attached zip file.
> | >
> | > Thanks,
> | >
> | > Steven Cheng
> | > Microsoft Online Support
> | >
> | > Get Secure! www.microsoft.com/security
> | > (This posting is provided "AS IS", with no warranties, and confers no
> | > rights.)
> | > --------------------
> | > | Thread-Topic: Page has Expired - using html input control (type=file)
> | > | thread-index: AcWnNnmpyUVC8RK8TrGwPGPd2vVDlw==
> | > | X-WBNR-Posting-Host: 209.17.159.193
> | > | From: =?Utf-8?B?TmF0aGFu?= <nathan.ethan@online.nospam>
> | > | References: <03E9432B-BF8B-4A36-93F1-DE26E8AE