asp.net-mvc - ASP.Net MVC 5 Html.DropDownListFor - 模型始终是 nu
问题描述
在我的模型中,我定义了以下内容:
公共字符串程序 {get;set;}
公共 IEnumerable ProgramList...
在我看来,我有:
@Html.DropDownListFor(model => model.Program, Model.ProgramList);
我的问题是,在视图中,模型始终为 NULL。在我看到的示例中,DropDownListFor 的第二个参数是硬编码值或枚举。
我正在尝试的可能吗?
为什么模型总是空的?
谢谢
解决方案
推荐阅读
- android - 添加flutter_contact插件后Flutter App gradle构建失败
- javascript - 将对象推入嵌套在对象数组中的对象数组中
- javascript - 在 forEach 循环后显示 HTML 时出现问题
- c# - 使用 SQL 数据库在 Azure 门户上部署 ASP.NET MVC 应用程序
- perforce - 在 Perforce 中,如何将普通用户更改为超级用户?
- python - 对已关闭文件的 I/O 操作。与熊猫
- php - 如何将 Symfony HttpClient 模拟为依赖项?
- python - Tensor(..., shape=(), dtype=int64) 必须与 Tensor(..., shape=(), dtype=resource) Keras 来自同一个图
- delphi - delphi用TStringList模拟fifo
- angular - 将 NGXS 状态分解为更小的可维护部分,但让它们彼此可访问的最佳方法是什么?