【发布时间】:2014-11-28 05:45:24
【问题描述】:
我在 Scripts/Ext 文件夹中的 Asp.NET MVC 应用程序上使用 Sencha Cmd 创建 ExtJs 5 测试应用程序:
我已经使用 Scripts/Ext 文件夹中的 index.html 文件成功运行了它:
我的脚本文件夹位于 localhost:63059/Scripts:
localhost:63059/Scripts/Ext/app.js
localhost:63059/Scripts/Ext/bootstrap.js
localhost:63059/Scripts/Ext/bootstrap.json
localhost:63059/Scripts/Ext/app/Application.js
etc...
起始页网址:localhost:63059/ 或 localhost:63059/Home/Index/
我在我的 _Layout.cshtml 中添加了 bootstrap.js:
<script id="microloader" type="text/javascript" src="~/Scripts/Ext/bootstrap.js"></script>
但是当我尝试在 HomeController IndexAction 中运行它时,出现错误: localhost:63059/bootstrap.json 加载资源失败:服务器响应状态为404(未找到)
如何使用 Sencha Cmd 更改生成的 ext 应用程序的默认 Web 路径?
【问题讨论】:
-
我建议您使用 ApiController 而不是 MVC,然后让您的 Extjs 应用程序与 Api 对话。此外,在您构建应用程序后,它可以位于服务器上的任何文件夹/路径中。控制器不需要重新调整Index.html!
标签: asp.net asp.net-mvc extjs extjs5