Hi
How the below Forms Authentication code works - FormsAuthentication.SetAuthCookie(UserName,false);
[HttpPost]
public ActionResult Login(string UserName , string Password)
{
int res = dbUser.Admin_Login(UserName , Password);
if (res == 1)
{
TempData["msg"] = "login Successfully...!";
FormsAuthentication.SetAuthCookie(UserName,false);
return RedirectToAction("Index", "Location");
}
else
{
TempData["msg"] = "Admin id or Password is wrong...!";
}
return View();
}
************ Web.Config
<authentication mode="Forms">
<forms loginUrl="~/Home/Login" timeout="30" />
</authentication>
Thanks