我試圖用具有使用ViewModel的下拉列表的數據填充編輯視圖。數據會填充,但Dropdownlists不會根據數據進行選擇。 已經在SO [SO1] [1],SO2,SO3中查看過類似的問題,但無法解決。知道這可能是我失蹤但無法找到的傻事。 代碼: 視圖模型: public class ProductVM
{
public int ID { get; set; }
比方說,我有這些模型: public class FilterModel
{
FilterPersonModel Person { get; set; }
FilterJobModel Job { get; set; }
}
public class FilterPersonModel
{
public string Name { get; set; }
enter image description here 在運行Visual Studio中的項目;我收到錯誤,如附圖所示。 public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute