- Joined
- Jul 17, 2006
- Messages
- 3
- Reaction score
- 0
Hello,
I have been struggling with this problem for a while now and cannot find a solution.
In application_onerror in the global.asax file I create an email which sends some information to a system administrator and then redirects to an error page. The email was to include some information that is stored in session variables. However when I access these variables as follows :
I get the following error :
Session.Count produces the same error, whilst accessing just the Session object itself does not.
I know that the session variables contain data as they are used throughout the application.
I read here that the session object is not available in the Application_OnAuthenticateRequest handler inside global.asax
Is this then also the case for application_onerror ?
thanks in advance.
I have been struggling with this problem for a while now and cannot find a solution.
In application_onerror in the global.asax file I create an email which sends some information to a system administrator and then redirects to an error page. The email was to include some information that is stored in session variables. However when I access these variables as follows :
Code:
Dim ProjectID as string = System.Web.HttpContext.Current.Session("ProjectId").ToString()
I get the following error :
Code:
Object reference not set to an instance of an object.
Session.Count produces the same error, whilst accessing just the Session object itself does not.
I know that the session variables contain data as they are used throughout the application.
I read here that the session object is not available in the Application_OnAuthenticateRequest handler inside global.asax
Is this then also the case for application_onerror ?
thanks in advance.