I have a partial view, which I am passing a model of type WebSite.Models.ManageModel which is simply
public class ManageModel
{
public string UserEmailAddress { get; set; }
public ManageUserViewModel ManageUserViewModel { get; set; }
}
I want to access the email address and place it into a TextBox in my partial view. So in that partial view I have
<div class="input-group">
<div class="col-md-10">
@Html.TextBoxFor(m => m.ManageUserViewModel.EmailAddress,
new
{
@class = "col-md-10 form-control",
@type = "text",
@placeholder = "Email Address",
@value = Model.UserEmailAddress
})
</div>
</div>
<span class="label label-danger">@Model.UserEmailAddress</span>
Now, the email address correctly displays in the label label-danger but not in my TexBox. What is wrong with this code?

Thanks for your time.
Edit. The action that launches the Manage view (which contains my partial views) is
// GET: /Account/Manage.
public ActionResult Manage(ManageMessageId? message)
{
ViewBag.StatusMessage =
message == ManageMessageId.ChangePasswordSuccess ?
"Your password has been changed":
message == ManageMessageId.SetPasswordSuccess ?
"Your password has been set" :
message == ManageMessageId.RemoveLoginSuccess ?
"The external login was removed" :
message == ManageMessageId.ChangeEmailAddressSuccess ?
"Your email address was successfully updated" :
message == ManageMessageId.Error ?
"An error has occurred." : "";
ViewBag.HasLocalPassword = HasPassword();
ViewBag.ReturnUrl = Url.Action("Manage");
// Not passing the model to the view, because I am
// unsure how to retrieve the information.
return View();
}
The problem is, I don't know how to retrieve the users data. My ManageUserViewModel is
public class ManageUserViewModel
{
[Required]
[EmailAddress(ErrorMessage = "Invalid email address.")]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email address")]
public string EmailAddress { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage =
"The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage =
"The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
I know I can get the ApplicationUser data via var user = UserManager.FindById(User.Identity.GetUserId()); but this is the default plus my added EmailAddress field, so it does not contain the password information. What should I be doing in this case?
public class ApplicationUser : IdentityUser
{
[DataType(DataType.EmailAddress)]
public string EmailAddress { get; set; }
}
TextBoxFor(m => m.UserEmailAddress...