Click here to Skip to main content
15,503,769 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError in my Entity Framework connection string Pin
Stephen Holdorf5-Jul-14 4:32
Stephen Holdorf5-Jul-14 4:32 
QuestionRe: Error in my Entity Framework connection string Pin
Stephen Holdorf5-Jul-14 11:44
Stephen Holdorf5-Jul-14 11:44 
QuestionRe: Error in my Entity Framework connection string Pin
Stephen Holdorf5-Jul-14 11:57
Stephen Holdorf5-Jul-14 11:57 
AnswerRe: Error in my Entity Framework connection string Pin
sankarsan parida6-Jul-14 8:49
professionalsankarsan parida6-Jul-14 8:49 
QuestionRe: Error in my Entity Framework connection string Pin
Stephen Holdorf6-Jul-14 14:54
Stephen Holdorf6-Jul-14 14:54 
AnswerRe: Error in my Entity Framework connection string Pin
sankarsan parida6-Jul-14 19:55
professionalsankarsan parida6-Jul-14 19:55 
QuestionDynamic menu problem when chaning from english to arabic language Pin
md_ismailz3-Jul-14 0:59
md_ismailz3-Jul-14 0:59 
QuestionHow to handle Invalid Session State on callback Pin
David Mujica1-Jul-14 12:00
David Mujica1-Jul-14 12:00 
VB

I have a page that performs a callback and I'm trying to handle the situation where the session has expired, but the callback is still being invoked.

I'm using the following code in my Global.asax

VB
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

       Dim httpApp As HttpApplication = Context.ApplicationInstance
       Dim httpEx As HttpException = httpApp.Server.GetLastError

       If (httpEx IsNot Nothing) Then
           If (httpEx.WebEventCode = System.Web.Management.WebEventCodes.AuditInvalidViewStateFailure Or _
                      httpEx.WebEventCode = System.Web.Management.WebEventCodes.InvalidViewState Or _
                      httpEx.WebEventCode = System.Web.Management.WebEventCodes.InvalidViewStateMac Or _
                      httpEx.WebEventCode = System.Web.Management.WebEventCodes.RuntimeErrorViewStateFailure) Then
               HttpContext.Current.ClearError()

               Response.Redirect("~/MyErrorPage.aspx", True)

           End If
       End If

   End Sub


The problem is that it is not redirecting to my error page.

I'm testing this out on an IIS7 server and I force the error by stopping, then restarting the application pool on the server in between requests. Maybe I'm performing the wrong type of test.

Shouldn't this re-direction work?

Am I performing the correct type of test ?

Ugh. Confused | :confused:
AnswerRe: How to handle Invalid Session State on callback Pin
Kornfeld Eliyahu Peter1-Jul-14 20:14
professionalKornfeld Eliyahu Peter1-Jul-14 20:14 
GeneralRe: How to handle Invalid Session State on callback Pin
David Mujica2-Jul-14 3:44
David Mujica2-Jul-14 3:44 
AnswerRe: How to handle Invalid Session State on callback Pin
Kornfeld Eliyahu Peter2-Jul-14 3:51
professionalKornfeld Eliyahu Peter2-Jul-14 3:51 
GeneralRe: How to handle Invalid Session State on callback Pin
David Mujica2-Jul-14 11:39
David Mujica2-Jul-14 11:39 
GeneralRe: How to handle Invalid Session State on callback Pin
Kornfeld Eliyahu Peter2-Jul-14 17:50
professionalKornfeld Eliyahu Peter2-Jul-14 17:50 
QuestionHow to populate Model that has a property referring to detail\child table in MVC 4 Pin
jeAntoni1-Jul-14 7:56
jeAntoni1-Jul-14 7:56 
AnswerRe: How to populate Model that has a property referring to detail\child table in MVC 4 Pin
Gourab Bose8-Jul-14 22:28
Gourab Bose8-Jul-14 22:28 
QuestionResize image without change in master image Pin
mor kan1-Jul-14 5:26
mor kan1-Jul-14 5:26 
AnswerRe: Resize image without change in master image Pin
Richard Deeming1-Jul-14 6:49
mveRichard Deeming1-Jul-14 6:49 
GeneralRe: Resize image without change in master image Pin
mor kan1-Jul-14 8:58
mor kan1-Jul-14 8:58 
GeneralRe: Resize image without change in master image Pin
mor kan1-Jul-14 9:03
mor kan1-Jul-14 9:03 
GeneralRe: Resize image without change in master image Pin
Richard Deeming1-Jul-14 9:31
mveRichard Deeming1-Jul-14 9:31 
Questionctl Prefix in ClientID Pin
Ali Al Omairi(Abu AlHassan)30-Jun-14 3:22
professionalAli Al Omairi(Abu AlHassan)30-Jun-14 3:22 
AnswerRe: ctl Prefix in ClientID Pin
Kornfeld Eliyahu Peter30-Jun-14 4:29
professionalKornfeld Eliyahu Peter30-Jun-14 4:29 
GeneralRe: ctl Prefix in ClientID Pin
Ali Al Omairi(Abu AlHassan)1-Jul-14 1:41
professionalAli Al Omairi(Abu AlHassan)1-Jul-14 1:41 
AnswerRe: ctl Prefix in ClientID Pin
Kornfeld Eliyahu Peter1-Jul-14 1:43
professionalKornfeld Eliyahu Peter1-Jul-14 1:43 
GeneralRe: ctl Prefix in ClientID Pin
Ali Al Omairi(Abu AlHassan)1-Jul-14 22:51
professionalAli Al Omairi(Abu AlHassan)1-Jul-14 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.