对于模型
ViewBag.Currency =new
SelectList(currencyBLL.GetList(ref pager,""),"Code","Name",model.Currency);
@Html.DropDownListFor(m => m.Currency, ViewBag.Currencyas
SelectList)
对于字典类型 如
Dictionary
ViewBag.FeeClassList =
new SelectList(m_BLL.GetFeeClass(),"Key",
"Value", entity.FeeClass);
本文介绍如何在ASP.NET MVC应用中使用ViewBag绑定下拉列表,包括从业务逻辑层获取数据并填充SelectList,以及如何在视图中通过HtmlHelper渲染这些数据。

被折叠的 条评论
为什么被折叠?



