I am new in ASP.NET and I am facing problem using Login Control that is built-in with ASP.NET.
I want to build an web application that has login control. I used ASP.NET Configuration wizard to setup the login authentication config. I have created 2 users and 2 roles allready, but the problem is, I can not login using the username/password of the user allready created in the database.
I have following code written in Login_Authenticate event:
if (User.Identity.IsAuthenticated == false)
Response.Redirect("frmUserLogin.aspx");
else if (Roles.IsUserInRole("Member"))
{
Response.Redirect("~/Protected/frmMemberHome.aspx");
}
First if condition refers to the situation when authentication fails else I have checked for the roles in which my user is included. Based on their roles, I have redirected them to different pages. That is all my plan to evaluate.
Problem is each time I am trying to login using correct username/password for existing user, it fails and shows error messages for Authentication Failure. I don't have any idea. I dont know, If I am doing wrong or not! Please help me out!