我的index.html
来自MVC应用程序的文件包含以下代码。所有文件都被加载到浏览器中,但没有来自Views文件夹的文件被加载。 Index.html
文件,脚本&视图文件夹位于根位置。java脚本文件404(未找到)
<body>
<div ng-view></div>
<script src="Scripts/jquery-1.9.1.min.js"></script>
<script src="Scripts/angular.min.js"></script>
<script src="Scripts/angular-route.min.js"></script>
<script src="Scripts/app.js"></script>
<script src="Views/Authentication/Services.js"></script> -- Error here
<script src="Views/Authentication/AuthenticationController.js"></script> -- Error here
</body>
文件夹结构
我得到以下错误消息时,我从铬devtool检查它。
http://localhost:58348/Views/Authentication/AuthenticationController.js
404(未找到)
即使我添加js/html
处理成的web.config,但仍然面临着同样的问题。
<add name="JavaScriptHandler" path="*.js" verb="*" preCondition="integratedMode"
type="System.Web.StaticFileHandler" />
<add name="HtmlScriptHandler" path="*.html" verb="*" preCondition="integratedMode"
type="System.Web.StaticFileHandler" />
我认为这是与路径的问题。 '脚本/ Vies ...'也许? – yhabib
是您的脚本在视图文件夹或脚本文件夹? – MPavlak
Index.html文件,脚本和视图文件夹位于根目录位置。 –