开发者

Access HiddenFor(Model=>Model.Id) MVC ASP.NET 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜