Last post Dec 23, 2011 09:49 PM by stevex33
Dec 23, 2011 07:14 PM|stevex33|LINK
I've got a class that I'm working with, and when it's run, I want to add something to the session, or access an existing session variable.
However I keep getting a null reference exception.
The class acts a route contraint if that matters:
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
but whenever code gets to that point, it crashes.
can anyone help me out please.
I know how to access session variables from within a page, but I didn't think it would be a difference when the place the code is running from isn't a page.
Dec 23, 2011 07:21 PM|MetalAsp.Net|LINK
Dec 23, 2011 07:26 PM|stevex33|LINK
thanks, unfortunately I'm still getting the same error, session is null.
Dec 23, 2011 09:49 PM|stevex33|LINK
I've seen that using "HttpContext.Current.Items" is the correct way to go.