NullReferenceException
-
Why am I getting this exception here?
if (Session["privilegios"] == null)
Isn't this the way its supposed to check for null? Best regards
Fratelli
-
Why am I getting this exception here?
if (Session["privilegios"] == null)
Isn't this the way its supposed to check for null? Best regards
Fratelli
-
Looks like Session itself is null Suggestion:
if (Session == null || Session["privilegios"] == null)
Yes, I already know what the problem is. For further reference: I had something like this
[WebMethod(EnableSession = true)]
public int method_1()
{
...
}[WebMethod]
public int method_2()
{
// Code that calls metod_1
}The thing is: If I call method_2, apperently, "Session" will still be null in method_1. I already have a previous post asking how to access "Session" variables in a non-WebMethod method. Regards
Fratelli
-
Yes, I already know what the problem is. For further reference: I had something like this
[WebMethod(EnableSession = true)]
public int method_1()
{
...
}[WebMethod]
public int method_2()
{
// Code that calls metod_1
}The thing is: If I call method_2, apperently, "Session" will still be null in method_1. I already have a previous post asking how to access "Session" variables in a non-WebMethod method. Regards
Fratelli