Html.HiddenFor value property not getting set

前端 未结 6 1705
借酒劲吻你
借酒劲吻你 2020-12-09 15:26

I could have used

@Html.HiddenFor(x=> ViewData[\"crn\"])

but, I get,

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 15:52

    Keep in mind the second parameter to @Html.HiddenFor will only be used to set the value when it can't find route or model data matching the field. Darin is correct, use view model.

提交回复
热议问题