如何在我的模型中将此下拉值传递给我的控制器
<div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">
<label for="email" style="font-family: Calibri; font-size: 18px;">Vendor Type:</label>
@Html.DropDownList("ActiveType", (IEnumerable<SelectListItem>)ViewBag.GetVendorType, new { id = "select2", @class = "select2_single form-control" })
</div>
答案 0 :(得分:-1)
您可以从Request对象中获取选定的值。将以下代码放入控制器操作代码中: string vendorType = Request.Form [&#34; select2&#34;]?。ToString();