473,727 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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_Err or(Object sender, EventArgs e)
{
Exception ex = Server.GetLastE rror().GetBaseE xception();
Session["MyErr"] = ex.Message.ToSt ring();
Server.ClearErr or();
Response.Write( "<script language='javas cript'>history. go(-1);
window.open('My ErrorPage.aspx' ,'Error','scrol lbars=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,

Nov 19 '05 #1
15 4772
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: AcWjgRNz1ihCOTG JT5CTuex0V4sWFg ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| Subject: Page has Expired - using html input control (type=file)
| Date: Wed, 17 Aug 2005 16:12:02 -0700
| Lines: 27
| Message-ID: <03************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1187 62
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| {
| Exception ex = Server.GetLastE rror().GetBaseE xception();
| Session["MyErr"] = ex.Message.ToSt ring();
| Server.ClearErr or();
| Response.Write( "<script language='javas cript'>history. go(-1);
|
window.open('My ErrorPage.aspx' ,'Error','scrol lbars=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?messa ge 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?messa ge?
|
| Thank you,
|
|

Nov 19 '05 #2
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_Err or(Object sender, EventArgs e)
{
Response.Clear( );
Exception objErr = Server.GetLastE rror().GetBaseE xception();
Session["MyErr"] = objErr.Message. ToString();
Server.ClearErr or();
Response.Write( "<SCRIPT
language='javas cript'>history. go(-1);
window.open('ht tp://www.msn.ca','Po pUp','scrollbar s=yes,width=500 ,height=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: AcWjgRNz1ihCOTG JT5CTuex0V4sWFg ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| Subject: Page has Expired - using html input control (type=file)
| Date: Wed, 17 Aug 2005 16:12:02 -0700
| Lines: 27
| Message-ID: <03************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1187 62
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| {
| Exception ex = Server.GetLastE rror().GetBaseE xception();
| Session["MyErr"] = ex.Message.ToSt ring();
| Server.ClearErr or();
| Response.Write( "<script language='javas cript'>history. go(-1);
|
window.open('My ErrorPage.aspx' ,'Error','scrol lbars=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�me ssage 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�me ssage?
|
| Thank you,
|
|

Nov 19 '05 #3
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: AcWkJWm3DrbB0rf 3RnWcVkmF7Y1jcQ ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| References: <03************ *************** *******@microso ft.com>
<CO************ **@TK2MSFTNGXA0 1.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: <89************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1189 64
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| {
| Response.Clear( );
| Exception objErr =
Server.GetLastE rror().GetBaseE xception();
| Session["MyErr"] = objErr.Message. ToString();
| Server.ClearErr or();
| Response.Write( "<SCRIPT
| language='javas cript'>history. go(-1);
|
window.open('ht tp://www.msn.ca','Po pUp','scrollbar s=yes,width=500 ,height=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: AcWjgRNz1ihCOTG JT5CTuex0V4sWFg ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | Subject: Page has Expired - using html input control (type=file)
| > | Date: Wed, 17 Aug 2005 16:12:02 -0700
| > | Lines: 27
| > | Message-ID: <03************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1187 62
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| > | {
| > | Exception ex = Server.GetLastE rror().GetBaseE xception();
| > | Session["MyErr"] = ex.Message.ToSt ring();
| > | Server.ClearErr or();
| > | Response.Write( "<script language='javas cript'>history. go(-1);
| > |
| >
window.open('My ErrorPage.aspx' ,'Error','scrol lbars=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â?mes sage 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,
| > |
| > |
| >
| >
|

Nov 19 '05 #4
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: AcWkJWm3DrbB0rf 3RnWcVkmF7Y1jcQ ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| References: <03************ *************** *******@microso ft.com>
<CO************ **@TK2MSFTNGXA0 1.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: <89************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1189 64
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| {
| Response.Clear( );
| Exception objErr =
Server.GetLastE rror().GetBaseE xception();
| Session["MyErr"] = objErr.Message. ToString();
| Server.ClearErr or();
| Response.Write( "<SCRIPT
| language='javas cript'>history. go(-1);
|
window.open('ht tp://www.msn.ca','Po pUp','scrollbar s=yes,width=500 ,height=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: AcWjgRNz1ihCOTG JT5CTuex0V4sWFg ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | Subject: Page has Expired - using html input control (type=file)
| > | Date: Wed, 17 Aug 2005 16:12:02 -0700
| > | Lines: 27
| > | Message-ID: <03************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1187 62
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| > | {
| > | Exception ex = Server.GetLastE rror().GetBaseE xception();
| > | Session["MyErr"] = ex.Message.ToSt ring();
| > | Server.ClearErr or();
| > | Response.Write( "<script language='javas cript'>history. go(-1);
| > |
| >
window.open('My ErrorPage.aspx' ,'Error','scrol lbars=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,
| > |
| > |
| >
| >
|

Nov 19 '05 #5
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: AcWk46GMpp9AjOz cRoC0iZ8I7zV7nQ ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| References: <03************ *************** *******@microso ft.com>
<CO************ **@TK2MSFTNGXA0 1.phx.gbl>
<89************ *************** *******@microso ft.com>
<Us************ **@TK2MSFTNGXA0 1.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: <7E************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1191 60
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWkJWm3DrbB0rf 3RnWcVkmF7Y1jcQ ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | References: <03************ *************** *******@microso ft.com>
| > <CO************ **@TK2MSFTNGXA0 1.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: <89************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1189 64
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| > | {
| > | Response.Clear( );
| > | Exception objErr =
| > Server.GetLastE rror().GetBaseE xception();
| > | Session["MyErr"] = objErr.Message. ToString();
| > | Server.ClearErr or();
| > | Response.Write( "<SCRIPT
| > | language='javas cript'>history. go(-1);
| > |
| >
window.open('ht tp://www.msn.ca','Po pUp','scrollbar s=yes,width=500 ,height=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: AcWjgRNz1ihCOTG JT5CTuex0V4sWFg ==
| > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | > | Subject: Page has Expired - using html input control (type=file)
| > | > | Date: Wed, 17 Aug 2005 16:12:02 -0700
| > | > | Lines: 27
| > | > | Message-ID: <03************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | Path:
| > TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | > | Xref: TK2MSFTNGXA01.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:1187 62
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| > | > | {
| > | > | Exception ex = Server.GetLastE rror().GetBaseE xception();
| > | > | Session["MyErr"] = ex.Message.ToSt ring();
| > | > | Server.ClearErr or();
| > | > | Response.Write( "<script
language='javas cript'>history. go(-1);
| > | > |
| > | >
| >
window.open('My ErrorPage.aspx' ,'Error','scrol lbars=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,
| > | > |
| > | > |
| > | >
| > | >
| > |
| >
| >
|

Nov 19 '05 #6
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: AcWk46GMpp9AjOz cRoC0iZ8I7zV7nQ ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| References: <03************ *************** *******@microso ft.com>
<CO************ **@TK2MSFTNGXA0 1.phx.gbl>
<89************ *************** *******@microso ft.com>
<Us************ **@TK2MSFTNGXA0 1.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: <7E************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1191 60
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWkJWm3DrbB0rf 3RnWcVkmF7Y1jcQ ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | References: <03************ *************** *******@microso ft.com>
| > <CO************ **@TK2MSFTNGXA0 1.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: <89************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1189 64
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| > | {
| > | Response.Clear( );
| > | Exception objErr =
| > Server.GetLastE rror().GetBaseE xception();
| > | Session["MyErr"] = objErr.Message. ToString();
| > | Server.ClearErr or();
| > | Response.Write( "<SCRIPT
| > | language='javas cript'>history. go(-1);
| > |
| >
window.open('ht tp://www.msn.ca','Po pUp','scrollbar s=yes,width=500 ,height=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: AcWjgRNz1ihCOTG JT5CTuex0V4sWFg ==
| > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | > | Subject: Page has Expired - using html input control (type=file)
| > | > | Date: Wed, 17 Aug 2005 16:12:02 -0700
| > | > | Lines: 27
| > | > | Message-ID: <03************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | Path:
| > TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | > | Xref: TK2MSFTNGXA01.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:1187 62
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender, EventArgs e)
| > | > | {
| > | > | Exception ex = Server.GetLastE rror().GetBaseE xception();
| > | > | Session["MyErr"] = ex.Message.ToSt ring();
| > | > | Server.ClearErr or();
| > | > | Response.Write( "<script
language='javas cript'>history. go(-1);
| > | > |
| > | >
| >
window.open('My ErrorPage.aspx' ,'Error','scrol lbars=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â ââ€?messa ge 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Ã

Nov 19 '05 #7
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: AcWnNnmpyUVC8RK 8TrGwPGPd2vVDlw ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| References: <03************ *************** *******@microso ft.com>
<CO************ **@TK2MSFTNGXA0 1.phx.gbl>
<89************ *************** *******@microso ft.com>
<Us************ **@TK2MSFTNGXA0 1.phx.gbl>
<7E************ *************** *******@microso ft.com>
<TT************ *@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: <76************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1195 13
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWk46GMpp9AjOz cRoC0iZ8I7zV7nQ ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | References: <03************ *************** *******@microso ft.com>
| > <CO************ **@TK2MSFTNGXA0 1.phx.gbl>
| > <89************ *************** *******@microso ft.com>
| > <Us************ **@TK2MSFTNGXA0 1.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: <7E************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1191 60
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWkJWm3DrbB0rf 3RnWcVkmF7Y1jcQ ==
| > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | > | References: <03************ *************** *******@microso ft.com>
| > | > <CO************ **@TK2MSFTNGXA0 1.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: <89************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA01.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:1189 64
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender,
EventArgs e)
| > | > | {
| > | > | Response.Clear( );
| > | > | Exception objErr =
| > | > Server.GetLastE rror().GetBaseE xception();
| > | > | Session["MyErr"] = objErr.Message. ToString();
| > | > | Server.ClearErr or();
| > | > | Response.Write( "<SCRIPT
| > | > | language='javas cript'>history. go(-1);
| > | > |
| > | >
| >
window.open('ht tp://www.msn.ca','Po pUp','scrollbar s=yes,width=500 ,height=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
| > | > | >

Nov 19 '05 #8
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.redire ct 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: AcWoP8Lxhq4lmuk HTK2jsgCG5P6scw ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| References: <03************ *************** *******@microso ft.com>
<CO************ **@TK2MSFTNGXA0 1.phx.gbl>
<89************ *************** *******@microso ft.com>
<Us************ **@TK2MSFTNGXA0 1.phx.gbl>
<7E************ *************** *******@microso ft.com>
<TT************ *@TK2MSFTNGXA01 .phx.gbl>
<76************ *************** *******@microso ft.com>
<bN************ **@TK2MSFTNGXA0 1.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: <F5************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGXA03.phx .gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1198 46
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWnNnmpyUVC8RK 8TrGwPGPd2vVDlw ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | References: <03************ *************** *******@microso ft.com>
| > <CO************ **@TK2MSFTNGXA0 1.phx.gbl>
| > <89************ *************** *******@microso ft.com>
| > <Us************ **@TK2MSFTNGXA0 1.phx.gbl>
| > <7E************ *************** *******@microso ft.com>
| > <TT************ *@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: <76************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1195 13
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWk46GMpp9AjOz cRoC0iZ8I7zV7nQ ==
| > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | > | References: <03************ *************** *******@microso ft.com>
| > | > <CO************ **@TK2MSFTNGXA0 1.phx.gbl>
| > | > <89************ *************** *******@microso ft.com>
| > | > <Us************ **@TK2MSFTNGXA0 1.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: <7E************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA01.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:1191 60
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWkJWm3DrbB0rf 3RnWcVkmF7Y1jcQ ==
| > | > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | > | > | References:
<03************ *************** *******@microso ft.com>
| > | > | > <CO************ **@TK2MSFTNGXA0 1.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:
<89************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | > | > | Xref: TK2MSFTNGXA01.p hx.gbl
| > | > | > microsoft.publi c.dotnet.framew ork.aspnet:1189 64
| > | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_Err or(Object sender,
| > EventArgs e)
| > | > | > | {
| > | > | > | Response.Clear( );
| > | > | > | Exception objErr =
| > | > | > Server.GetLastE rror().GetBaseE xception();
| > | > | > | Session["MyErr"] = objErr.Message. ToString();
| > | > | > | Server.ClearErr or();
| > | > | > | Response.Write( "<SCRIPT
| > | > | > | language='javas cript'>history. go(-1);
| > | > | > |
| > | > | >
| > | >
| >
window.open('ht tp://www.msn.ca','Po pUp','scrollbar s=yes,width=500 ,height=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
| > | > | > | >
|

Nov 19 '05 #9
We can not use Response.Redire ct 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:
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.redire ct 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: AcWoP8Lxhq4lmuk HTK2jsgCG5P6scw ==
| X-WBNR-Posting-Host: 209.17.159.193
| From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| References: <03************ *************** *******@microso ft.com>
<CO************ **@TK2MSFTNGXA0 1.phx.gbl>
<89************ *************** *******@microso ft.com>
<Us************ **@TK2MSFTNGXA0 1.phx.gbl>
<7E************ *************** *******@microso ft.com>
<TT************ *@TK2MSFTNGXA01 .phx.gbl>
<76************ *************** *******@microso ft.com>
<bN************ **@TK2MSFTNGXA0 1.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: <F5************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGXA03.phx .gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1198 46
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWnNnmpyUVC8RK 8TrGwPGPd2vVDlw ==
| > | X-WBNR-Posting-Host: 209.17.159.193
| > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | References: <03************ *************** *******@microso ft.com>
| > <CO************ **@TK2MSFTNGXA0 1.phx.gbl>
| > <89************ *************** *******@microso ft.com>
| > <Us************ **@TK2MSFTNGXA0 1.phx.gbl>
| > <7E************ *************** *******@microso ft.com>
| > <TT************ *@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: <76************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1195 13
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWk46GMpp9AjOz cRoC0iZ8I7zV7nQ ==
| > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | > | References: <03************ *************** *******@microso ft.com>
| > | > <CO************ **@TK2MSFTNGXA0 1.phx.gbl>
| > | > <89************ *************** *******@microso ft.com>
| > | > <Us************ **@TK2MSFTNGXA0 1.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: <7E************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA01.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:1191 60
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: AcWkJWm3DrbB0rf 3RnWcVkmF7Y1jcQ ==
| > | > | > | X-WBNR-Posting-Host: 209.17.159.193
| > | > | > | From: =?Utf-8?B?TmF0aGFu?= <na**********@o nline.nospam>
| > | > | > | References:
<03************ *************** *******@microso ft.com>
| > | > | > <CO************ **@TK2MSFTNGXA0 1.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:
<89************ *************** *******@microso ft.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.publi c.dotnet.framew ork.aspnet
| > | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | > | > | Xref: TK2MSFTNGXA01.p hx.gbl
| > | > | > microsoft.publi c.dotnet.framew ork.aspnet:1189 64
| > | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
20474
by: Don | last post by:
Is there some way to populate the "Browse" box for a <input type=file...> with a default value? I can do it for <input type=text...>, but can't seem to do it for <input type=file...>. Any ideas? Thanks, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
1
10881
by: Axe | last post by:
Here's the problem: I've got an ASP.NET (C#) web page that has a single <input type=file> control on it for uploading a file. The way the code works is that the uploaded file is then parsed for the path and file name. I then save the posted file to a temporary directory on the web server (for later processing). I then open up a file stream and stream reader and read a related file into a string that is in the posted file's same directory...
1
2177
by: Brian Henry | last post by:
When I use the file upload control <input type = file> and try to upload an exe file it errors, how do i get it to allow exe file uploads so I can display a frendly warrning message about they might be dangerous? thanks!
11
2371
by: TJM | last post by:
Hi, A Javascript error is generated when the user types a few character in an INPUT TYPE=FILE and hits a submit button. The form does not post. Is there a solution to this problem? Thanks TJM
12
3974
by: Larry Bud | last post by:
I rarely crosspost, but this affects both ASP and Javascript REALLY odd bug that I ran across in ASP 3.0. I have an input type of file, user clicks browse, then places his cursor in the filename, puts a space at the end of the file, and uploads it. Web server doesn't translate the MIME type of document properly because it doesn't end with a valid extension, yet the file itself uploads successfully. I'm using SAFileUP for my uploading...
12
9633
by: menmysql | last post by:
hi i want to dispaly an image on my webpage which is selected using <input type="file">. is it possible. please reply urgent regards
9
17016
by: Roger Withnell | last post by:
I am building a website in Russian. What options do I have to make the "Browse" button display in other languages? Thanking you in anticipation. Posted Via Usenet.com Premium Usenet Newsgroup Services
3
2024
by: Smith | last post by:
Hi Is there a way tu upload many files with a input type file control? Thanks
6
11759
by: Gorksha | last post by:
How to upload a file without using browse button provided by <input type=file > tag in html..
0
8891
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9406
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9261
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8106
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6703
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2641
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2158
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.