如何在mvc中用ViewData填充的下拉列表中设置选定的值

时间:2021-04-04 07:09:50
【文件属性】:
文件名称:如何在mvc中用ViewData填充的下拉列表中设置选定的值
文件大小:47KB
文件格式:ZIP
更新时间:2021-04-04 07:09:50
C# MVC Razor ASP.NET 我得到了解决方案.....谢谢大家的回应。 @ Html.DropDownListFor(model => item.Data.CategoryID,新的SelectList((IEnumerable)ViewData [“ categories”],“ CategoryID”,“ CategoryName”,item.Data.CategoryID),“-选择类别-”,新{@id =“ category” + i})正在声明选择列表...
【文件预览】:
how-to-set-the-selected-value-in-the-drop-down-lis.pdf

网友评论