我的难处是如何使用ViewBag
和DropdownListFor
?难以使用ASP.NET MVC ViewBag和DropDownListfor
在我的控制,我有:
TestModel model = new TestModel();
ViewBag.Clients = model.Clients;
ViewBag.StatusList = model.StatusList;
ViewBag.enumStatus = model.enumStatus;
ViewBag.intClient = model.intClient;
在我TestModel
public SelectList Clients { get; set; }
public SelectList StatusList { get; set; }
public ActiveStatus enumStatus { get; set; }
public int? intClient { get; set; }
在我看来
我想用DropDownListFor
显示ViewBag值,我该怎么办那?
我使用ViewBag传递的价值观,在这里that's难度 – learning 2011-03-22 05:59:39
如何使用ViewBag值来填充dropdownlistfor? – learning 2011-03-22 06:14:28
与IEnumerable完美结合 ...我使用ViewBag传递值并且像魅力一样工作。谢谢! –
Equiman
2015-11-03 04:09:43