ahmed salah

ahmed salah

  • 1.8k
  • 393
  • 23.7k

websecurity login not logged success althogth i have same user name an

Nov 4 2022 3:41 PM

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

  1. ModelState.AddModelError


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