websecurity login not logged success althogth i have same user name and password on membership table ?

ahmed salah 3,216 Reputation points
2022-11-04T15:35:01.383+00:00

I working on c# web application i use the following code to login
but it not logged success

it show model state error although i have same user name and password on database
so how to solve this issue please

 public JsonResult Login(LoginModel model, string returnUrl)  
        {  
            if (WebSecurity.Login(model.UserName, model.Password, model.RememberMe))  
            {  
              
            }  
  
            ModelState.AddModelError("", "error");  
            return Json(new { Ok = false, Message = main.LoginError, status = "activated" });  
        }  

so when make break point to WebSecurity.Login it not go to inside if statement
it go to

ModelState.AddModelError  

i have same user name and password that exist on table webpages_Membership
so what i do to solve issue please

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,375 questions
{count} votes