我的難處是如何使用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