How to use hidden field values from view to controller in asp.net mvc 3

前端 未结 3 1544
滥情空心
滥情空心 2021-02-08 03:38

I have to pass hidden filed values to controller action. So I have tried in the following way, but I am getting null values.

I have tried both methods i.e formcollection

3条回答
  •  一整个雨季
    2021-02-08 04:09

    Try this, In Razor view:

    @using (Html.BeginForm(new { id = "postform" }))
    {
          @Html.HiddenFor(m=>m.hiddevalue)
         
    }
    

提交回复
热议问题