public ActionResult Profile(CustomProfileViewModel model) { if (ModelState.IsValid) { CustomProfile profile = CustomProfile.GetUserProfile(User.Identity.Name); profile.Nom = model.Nom; profile.PCognom = model.PCognom; profile.SCognom = model.SCognom; profile.Save(); return RedirectToAction("Profile", "Account"); } return View(model); }
public ActionResult Profile() { CustomProfile profile = CustomProfile.GetUserProfile(User.Identity.Name); var model = new CustomProfileViewModel { Nom = profile.Nom, PCognom = profile.PCognom, SCognom = profile.SCognom }; return View(model); }