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
Mark Tabor
587
2k
460.6k
Updating identity table aspnetuser in mvc web application
Mar 30 2020 10:16 PM
I am using asp.net identity for signup and signin for email confirmation i am using my own code but on email confirmation i want to update the records in aspnetuser table like emailconfirmed field to true , but it is not updating
and db.savechanges()>0 always false
check the below code.
public
JsonResult RegisterConfirm(
string
regId)
{
OurHealthisWealthEntities db =
new
OurHealthisWealthEntities();
var userList = UserManager.Users.Where(x=>x.Id==regId).FirstOrDefault();
userList.EmailConfirmed =
true
;
userList.PhoneNumber =
"123123123123"
;
//db.Entry(userList).State = EntityState.Modified;
if
(db.SaveChanges()>0)
{
var msg =
"Your Email Is Verified!"
;
return
Json(msg, JsonRequestBehavior.AllowGet);
}
else
{
var msg =
"your email is not verified!"
;
return
Json(msg, JsonRequestBehavior.AllowGet);
}
}
Even committed line when uncomment it still not updating the record
Reply
Answers (
12
)
Help on pushing a hidden button with javascript
HOW To Add script to the end of the ASP.NET page