TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arjun Dhilod
958
812
106.1k
An error occurred while processing your request. MVC 4
Jun 7 2018 7:47 AM
[AllowAnonymous]
public ActionResult Login(string returnUrl)
{
try
{
ViewBag.Success = TempData["Message"];
LoginModel model = new LoginModel();
if ((User.Identity as SimpleIdentity) != null)
{
if ((User.Identity as SimpleIdentity).IsAdministrator || (User.Identity as SimpleIdentity).RoleName.ToLower() == "admin")
{
return RedirectToAction("AdminView", "Admin");
}
else if ((User.Identity as SimpleIdentity).RoleName.ToLower() == "dietitian")
{
return RedirectToAction("DieticianView", "Admin");
}
return RedirectToAction("Index", "Dashboard");
}
if (HttpContext.Request.Cookies["RememberMe"] != null)
{
model.UserName = HttpContext.Request.Cookies["RememberMe"]["UserName"];
model.Password = BaseModel.Decrypt(HttpContext.Request.Cookies["RememberMe"]["Password"]);
model.RememberMe = Convert.ToBoolean(HttpContext.Request.Cookies["RememberMe"]["Rememberme"]);
}
ViewBag.ReturnUrl = returnUrl;
return View(model);
}
catch (Exception ex)
{
logger.Error(ex.Message, ex);
return View("Error");
}
}
i am new in MVC i am getting above error when saving
cookies pls check and let me know if some know the solution
Reply
Answers (
2
)
Database Backup in asp.net web project
[.NET Core] Edit Excel by website