ASP.net MVC强类型视图下拉列表为空(ASP.net MVC strongly typed view dropdownlist is empty)

编程入门 行业动态 更新时间:2024-10-28 08:24:06
ASP.net MVC强类型视图下拉列表为空(ASP.net MVC strongly typed view dropdownlist is empty)

对于Sitecore7解决方案,我设置了一个ASP.net MVC3项目。 我正在尝试使用“添加视图”向导向我的控制器操作添加新视图,方法是在View()代码>添加视图上单击右键。

public class HomeController : SitecoreController { public ActionResult Add() { return View(); } }

显示“添加视图”向导,但是当我选中“创建强类型视图”复选框时,Model类下拉列表为空。

没有构建错误。 但是我清理,构建并重建了解决方案,但这并不能解决问题。 我正在使用Visual Studio 2012,环境已完全更新。 我搜索了互联网,发现了这个类似的问题 ,但解决方案并没有解决问题。

我试图在一天内修复它,但没有成功。 有谁知道解决方案?

非常感谢。

约迪

For a Sitecore7 solution I setup an ASP.net MVC3 project. I'm trying to add a new view to my controller action using the "Add view" wizard, by clicking right on the View() code > Add view.

public class HomeController : SitecoreController { public ActionResult Add() { return View(); } }

The "Add view" wizard shows up, but when I checked the checkbox "Create a strongly-typed view" the Model class dropdownlist is empty.

There are no build errors. However I cleaned, build and rebuild the solution, but that doesn't fix the problem. I'm using Visual Studio 2012 and the enviroment is completely updated. I searched the internet and found this simular looking issue, but the solution doesn't fix the problem.

I have tried to fix it in a day, without success. Does anyone know a solution?

Thanks a lot.

Jordy

最满意答案

1.FIRST你在你的应用程序中删除所有文件。文件夹。尝试构建应用程序。 或2.DO第一步如果您正在使用EF尝试通过从包管理器控制台中键入“update-database”来更新您的数据库

1.FIRST YOU DELETE ALL FILES IN YOUR APPLICATION BIN FOLDER.THEN TRY BUILD THE APPLICATION. OR 2.DO THE FIRST STEP AND IF YOU ARE USING EF TRY TO UPDATE YOUR DATABASE BY TYPING "update-database" from your package manager console

更多推荐

本文发布于:2023-07-28 19:10:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1308227.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   为空   类型   列表   MVC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!