问题描述:

@Html.Encode(User.Identity.Name)

Above this is in MVC 4 Razor view html Helper method control. it exists in _Layout.cshtml file and I want to get the User name from this Control and want to set it in html HtmlHelper method control which is below.

@Html.EditorFor(model => model.UserName)

But both views have their separate Models so how can I get User name and pass it into

@Html.EditorFor(model => model.UserName)

and when I Click save button it should save in Database.

Any help would be appreciate.

相关阅读:
Top