【发布时间】:2014-06-25 00:45:57
【问题描述】:
我正在尝试将 cshtml 与 Durandal 一起使用
我遵循了关于 http://bartwullems.blogspot.com/2014/03/durandaljs-enable-razor-views.html
main.js 被正确调用,但是当它去寻找视图时,我得到了错误。
未找到视图。通过路径“text!views/shell.cshtml”搜索“views/shell”。
在控制台窗口中我可以看到 404 错误
http://local /App/views/shell.cshtml 404(未找到)
路由已配置,我将 web.config 从 View 复制到 App/views 并且 DurandalViewController 也已到位。 我的 main.js 看起来像示例中的一个 只有最后一行是
app.setRoot('viewmodels/shell');
__________________________________
结构有
- App/viewmodels/shell.js
- App/views/shell.cshtml
- App/views/web.config
【问题讨论】:
标签: razor durandal single-page-application