我使用以下方法将 MVC 2.0 站点迁移到 MVC 3.0:迁移 MVC 2.0 -> 3.0 http://www.asp.net/learn/whitepapers/mvc3-release-notes#0.1__Toc274034214
使用 ASPX 作为视图引擎现在效果很好......
但我尝试创建 Razor 视图并收到错误:
The view 'TestView' or its master was not found. The following locations were searched:
~/TestView.aspx
~/TestView.ascx
~/Views/Color/TestView.aspx
~/Views/Color/TestView.ascx
~/Views/Shared/TestView.aspx
~/Views/Shared/TestView.ascx
我怎样才能启用剃须刀?
我正在使用 Visual Studio 2010...
创建全新的 MVC 3 Web 应用程序使 Razor 变得更加出色!
Thanks
尝试添加ViewEngines.Engines.Add(new RazorViewEngine());
到您的 global.asax 文件
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)