HTML.HiddenFor value set
问题 @Html.HiddenFor(model => model.title, new { id= "natureOfVisitField", @value = '@Model.title'}) it doesen't work! how to set the value? 回答1: You shouldn't need to set the value in the attributes parameter. MVC should automatically bind it for you. @Html.HiddenFor(model => model.title, new { id= "natureOfVisitField" }) 回答2: For setting value in hidden field do in the following way: @Html.HiddenFor(model => model.title, new { id= "natureOfVisitField", Value = @Model.title}) It will work 回答3: