I have a Login Class which has a function: isCorrect() that takes username and password as two attributes And a asp.net WebService To allow using AJAX.
LoginService.cs
public Login CorrectLogin(string username, string password)
{
Login thisLogin = Login.isCorrect(username, password);
int thisLoggedinUserID = thisLogin.LoggedinUserID;
if (thisLoggedinUserID != 0)
{
Session["loggedinUser"] = thisLoggedinUserID;
}
return thisLogin;
}
When I want to set value of Session["loggedinUser"] = thisLoggedinUserID this error accrues:
Object reference not set to an instance of an object.
I can't understand what is solution.