I have login control on my asp.net web site with custom Authenticate does it possible to use login status, login view without any membership provider?
All i need is remember me function and check if use is logged in and whats is username
This is my custom authenticate:
string username = Login1.UserName;
string password = Login1.Password;
bool result = UserLogin(username, password);
if (result)
{
e.Authenticated = true;
}
else
{
e.Authenticated = false;
}
private bool UserLogin(string userName, string password)
{
DataClassesDataContext db = new DataClassesDataContext();
var _SelectedName = (from d in db.users where d.username == userName && d.password == d.password select d.username).SingleOrDefault();
if (_SelectedName == null)
{
return false;
}
else
{
return true;
}
}
Yes, you can use the
LoginStatusandLoginViewcontrols without a membership provider. They only require thatHttpContext.Userbe properly set, which theLogincontrol should handle for you.