【问题标题】:Run Ext.js 5 application with Asp.NET MVC使用 Asp.NET MVC 运行 Ext.js 5 应用程序
【发布时间】: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


【解决方案1】:

尝试如下加载引导程序,将脚本放在内容文件夹中

   <script src="@Url.Content("~/Content/js/libs/bootstrap.js")" type="text/javascript"></script>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-25
  • 2013-02-21
  • 1970-01-01
  • 1970-01-01
  • 2020-02-28
  • 2014-05-13
  • 2013-12-05
相关资源
最近更新 更多