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
Rucha Pandya
NA
7
702
I am trying to hash my password and then trying to store it
Feb 12 2016 6:03 AM
Below is my code and m trying to hash my password in mvc
but it is showing error like crypto not exists I m using vs2012
public ActionResult Login(LoginViewModel model)
{
if (ModelState.IsValid)
{
var search = db.Logins.FirstOrDefault(x => x.UserEmail == model.UserEmail);
if (search != null)
{
if (Crypto.VerifyHashedPassword(search.UserPass, model.UserPass))
{
SessionWrapper.UserRole = search.Role.RoleName;
SessionWrapper.UserId = search.UserID;
SessionWrapper.UserEmail = search.UserEmail;
switch (SessionWrapper.UserRole)
case "Admin":
return Redirect("~/Admin/Dashboard");
break;
case "Customer":
return Redirect("~/Customer/Dashboard");
break;
case "Staff":
return Redirect("~/Staff/Dashboard");
break;
Reply
Answers (
2
)
Uniqueness between 3 fields
How to stop page Reloading in mvc4 using j -query?