public ActionResult UpdateAccount(SiteMember model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var updatePasswordSuccessful = true;
                    var member = Membership.GetUser(model.UserName);
                    member.Email = model.Email;
                    Membership.UpdateUser(member);

                    if(!string.IsNullOrEmpty(model.NewPassword))
                    {
                        updatePasswordSuccessful = member.ChangePassword(model.OldPassword, model.NewPassword);
                    }

                    if (!updatePasswordSuccessful)
                    {
                        ModelState.AddModelError("Error", "The old password was not recognized.");
                    }
                    else
                    {
                       //This is the collection that we use to pass data back 
                       //on redirect.
                       TempData.Add("Success", "Your account has been updated successfully.");
                    }

                    return RedirectToCurrentUmbracoPage();
                }
                catch (Exception ex)
                {
                    LogHelper.Error(this.GetType(), "Account Creation Error", ex);
                    ModelState.AddModelError("Error", "We are sorry, but the system encountered an error. Please try again.");
                }
            }

            return CurrentUmbracoPage();
        }
 public ActionResult MyAccount()
 {
     var member = Membership.GetUser(User.Identity.Name);
     var model = new SiteMember { 
         UserName = member.UserName,
         Email = member.Email
     };
     return View(model);
 }