ASP.NET MVC 5 + ASP.NET Identity Framework 2.0 – Customized User Account Attribute ( Update Customized Account Attribute )
1. Update “Manage" Controller – “Update" Method from the File “\Controllers\ManageController.cs" as follow.
[HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Update(ManageMessageId? message) { … … ApplicationUser user = UserManager.FindById(User.Identity.GetUserId()); user.PostTitle = "< Attribute Value >"; user.Attr1 = "< Attribute Value >"; user.Attr2 = "< Attribute Value >"; user.Attr3 = "< Attribute Value >"; UserManager.Update(user); return View(“Index"); } |