Hi,
Is there anyone know how to detect and redirect the page when hit the error
message as below:-
Thanks,
Kenny
Server Error in '/MobileMM' Application.
----------------------------------------------------------------------------
----
The page requires session state that is no longer available. Either the
session has expired, the client did not send a valid session cookie, or the
session state history size is too small. Try increasing the history size or
session expiry limit.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Exception: The page requires session state that is
no longer available. Either the session has expired, the client did not send
a valid session cookie, or the session state history size is too small. Try
increasing the history size or session expiry limit.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[Exception: The page requires session state that is no longer available.
Either the session has expired, the client did not send a valid session
cookie, or the session state history size is too small. Try increasing the
history size or session expiry limit.]
System.Web.UI.MobileControls.MobilePage.OnViewStateExpire(EventArgs e) +45
System.Web.UI.MobileControls.MobilePage.LoadPageStateFromPersistenceMedium()
+315
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +423
----------------------------------------------------------------------------
----
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
steph - 23 Oct 2003 12:16 GMT
In vb:
Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub
>-----Original Message-----
>Hi,
[quoted text clipped - 34 lines]
>Either the session has expired, the client did not send a valid session
>cookie, or the session state history size is too small.
Try increasing the
>history size or session expiry limit.]
>System.Web.UI.MobileControls.MobilePage.OnViewStateExpire(EventArgs e) +45
[quoted text clipped - 9 lines]
>
>.
Kenny - 29 Oct 2003 11:31 GMT
Hi Steph,
Now I am able to redirect the main page to the login page when session
expired with OnViewStateExpire. What if a user click the login button after
few minits and hit the session timeout again?
I just wonder why the new session is not created only when the user click
the login button?
I though by adding this
> In vb:
>
[quoted text clipped - 74 lines]
> >
> >.
Kenny - 29 Oct 2003 11:38 GMT
Hi Steph,
Now I am able to redirect the main page to the login page when session
expired with OnViewStateExpire. What to do if a user click the login button
(*after 1 min) and hit the session timeout again?
I just wonder why the new session is not created only when the user click
the login button? and How?
I though by adding Session.Abondon can solve the problem but it seems like
when I click the Login button (* after 1 min), the program still calling the
OnViewStateExpire and give me timeout message.
Protected Overrides Sub OnViewStateExpire(ByVal e As EventArgs)
Session.Abondon()
RedirectToMobilePage("MobileLogin.aspx?err=timeout")
End Sub
Currently I set the SessionTimeout to 1 for testing purpose.
tx,
Kenny
> In vb:
>
[quoted text clipped - 74 lines]
> >
> >.
Cheryl - 29 Oct 2003 22:03 GMT
To catch a page error you can always use this:
Private Sub Page_Error(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Error
' Add some code here to log error if desired
Server.Transfer("CustomErrorPage.aspx")
End Sub
This will handle any errors in your page and redirect to an error
page. Before redirecting you could log the errors somewhere if you
want to see what it is but that way the user gets a nice friendly
page.
> Hi Steph,
>
[quoted text clipped - 97 lines]
> > >
> > >.
steph - 23 Oct 2003 12:16 GMT
In vb:
Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub
>-----Original Message-----
>Hi,
[quoted text clipped - 34 lines]
>Either the session has expired, the client did not send a valid session
>cookie, or the session state history size is too small.
Try increasing the
>history size or session expiry limit.]
>System.Web.UI.MobileControls.MobilePage.OnViewStateExpire(EventArgs e) +45
[quoted text clipped - 9 lines]
>
>.
steph - 23 Oct 2003 12:16 GMT
In vb:
Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub
>-----Original Message-----
>Hi,
[quoted text clipped - 34 lines]
>Either the session has expired, the client did not send a valid session
>cookie, or the session state history size is too small.
Try increasing the
>history size or session expiry limit.]
>System.Web.UI.MobileControls.MobilePage.OnViewStateExpire(EventArgs e) +45
[quoted text clipped - 9 lines]
>
>.