开发者

Access HiddenFor(Model=>Model.Id) MVC ASP.NET in Controller

开发者 https://www.devze.com 2023-03-20 23:19 出处:网络
How do I access the following written in View @Html.HiddenFor(Model=>开发者_C百科;Model.id) in Controller

How do I access the following written in View

 @Html.HiddenFor(Model=>开发者_C百科;Model.id)

in Controller ?

Thank you


Create a Action method that takes the Type that you used as Model in your view.

[HttpPost]
public ActionResult Create(MyModel model)
{
   var id = model.id;//the id in @Html.HiddenFor(Model=>Model.id)
}
0

精彩评论

暂无评论...
验证码 换一张
取 消