<pre lang="c#"> public ActionResult Login(LoginModel model, string returnUrl) { if (User.Identity.IsAuthenticated)//this is get always false { string user = User.Identity.Name;//here i need username } if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) { return RedirectToLocal(returnUrl); } // If we got this far, something failed, redisplay form ModelState.AddModelError("", "The user name or password provided is incorrect."); return View(model); }
User.Identity.IsAuthenticated always return false so userid comes always -1, I am not even able to short out my mistake, what mistake am doing and how can i overcome with this, please help me..
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)