关于DroupDownList

来源:互联网 发布:云数据库怎么使用 编辑:程序博客网 时间:2024/06/15 05:33

1.通过实例化SelectList

  ViewBag.AgencyBidBodyId = new SelectList(db.BiddingBodies, "Id", "BiddingBodyType");

视图

 @Html.DropDownList("AgencyBidBodyId", null, htmlAttributes: new { @class = "form-control" })

2.

0 0