从下拉列表中传递参数@ using(Html.BeginForm)

时间:2016-04-07 08:16:27

标签: asp.net-mvc-4

我有以下代码,我想从下拉列表中传递选定的值,当我提交按钮时,参数的值应该从selectedvalue而不是" 1"

读取
<td style="width:25%;">
    @Html.DropDownList( "ClientTypeId", null, new {@class="table",style="width: 70%; height:100%;"})
</td>
<td style="width:25%;">
</td>
<td style="width:25%;">
</td>
<td style="width:25%;">
     @using (Html.BeginForm("View", "Client", new { ClientTypeId =  1 }, FormMethod.Post, null))
     {
          <input type="submit" value="Search" class="btn btn-default"  />
     }
</td>

1 个答案:

答案 0 :(得分:0)

请在表单(@using(Html.BeginForm))标记内添加下拉列表。您将获得您的数据。

相关问题