Controller.cs [HttpPost] public ActionResult LogIn(ECusertables user,int id=0) { if (IsValid(user.Email, user.Password)) { user = db.ECusertables.Where(u => u.Email == user.Email).Select(i => i).FirstOrDefault(); FormsAuthentication.SetAuthCookie(user.Email, false); } } View.Cshtml @if (Request.IsAuthenticated) { <div align="right" style="margin-removed10px;"> @Html.Encode(User.Identity.Name) </div> } Thanks in adavnce.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)