无法加载资源MVC 4 JavaScript [英] Cannot load resource MVC 4 JavaScript

查看:42
本文介绍了无法加载资源MVC 4 JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以下错误的帮助.似乎找不到scripts文件夹之外的WarehouseJavascript.js文件.

I need help with the below error. It cant seem to find the WarehouseJavascript.js file which is outside the scripts folder.

推荐答案

在您的Views文件夹中应该有一个web.config文件.在其中,找到 system.web/httpHandlers 部分,并根据以下答案在通配符404处理程序行之前找到静态文件处理程序行:https://stackoverflow.com/a/6453724/426894

In your Views folder there should be a web.config file. In it, find the system.web/httpHandlers section, and a static file handler line before the wildcard 404 handler line per the answer here: https://stackoverflow.com/a/6453724/426894

<httpHandlers>
  <add path="*.js" verb="GET,HEAD" type="System.Web.StaticFileHandler" />
  <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>

这篇关于无法加载资源MVC 4 JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆