MVC:不能通过HttpGet/Post方法访问js文件

本文关键字:方法 Post 访问 js 文件 HttpGet 不能 MVC | 更新日期: 2023-09-27 18:14:42

我正在使用MVC 3.0 + Jquery + HTTPGet/Post方法做简单的get操作。几个小时前,我的js工作得很好。立即它得到错误的js没有找到…物理路径与之前相同…

调试器在运行时点击视图。但是不能点击Get Method

我_Layout.cshtml

<head>
    <title>@ViewBag.Title</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/js/dashboard/eut.js")" type="text/javascript"></script>
</head>
<body>
    @RenderBody()
</body>
控制器

  public class EUTController : Controller
    {
        [HttpPost]
        public JsonResult GetSite()  {//getOperation }
        public ActionResult Index() { return View(); }
    }

MyView

@model Dashboard.Model.SoftwareReadiness.SwReadiness
<p>
    @Html.DropDownListFor(x => x.Activity, new SelectList(Enumerable.Empty<SelectListItem>()))
</p>

My eut.js

$(document).ready(function () {
 getProducts();
});
function getProducts() {
    $.post("EUT/GetSite", null,
            function (jsonResult) {
                alert(jsonResult);
            })
        .fail(function (jqXHR, textStatus, errorThrown) { alert( errorThrown); });

网络。配置

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=152368
  -->
<configuration>
  <configSections>
    <section name="repositoryMappingsConfiguration" type="Infrastructure.RepositoryFramework.Configuration.RepositorySettings, Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    <section name="entityMappingsConfiguration" type="Infrastructure.EntityFactoryFramework.Configuration.EntitySettings, Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>
  <appSettings>
    <add key="webpages:Version" value="1.0.0.0" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <!--<authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn" timeout="2880" />
    </authentication>-->
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
    <modules>
      <remove name="UrlRoutingModule-4.0" />
      <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
    </modules>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <repositoryMappingsConfiguration>
    <repositoryMappings>
      <repositoryMapping interfaceShortTypeName="ISiteRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Sites.SiteRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IProductRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Products.ProductRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISupplierRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Suppliers.SupplierRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IUserRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Users.UserRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IConfigRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Configs.ConfigRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IUserConfigRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.UserConfigs.UserConfigRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ICustomerRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Customers.CustomerRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IDRightRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.DRights.DRightRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IURightRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.URights.URightRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ITestLocationRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.TestLocations.TestLocationRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ICountryRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Countries.CountryRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IActivityRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Activitys.ActivityRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IAutoSmsRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.AutoSmss.AutoSmsRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IPriorityErrorRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.PriorityErrors.PriorityErrorRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IClaimRateRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.ClaimRates.ClaimRateRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IProductClaimRateRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.ProductClaimRates.ProductClaimRateRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISymptomClaimRateRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.SymptomClaimRates.SymptomClaimRateRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IMtbfTrendRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.MtbfTrends.MtbfTrendRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ILOCRRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.LOCRs.LOCRRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISurveyRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Surveys.SurveyRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISurveyQuestionRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.SurveyQuestions.SurveyQuestionRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISurveyQuestionOptionRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.SurveyQuestionOptions.SurveyQuestionOptionRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISurveyAnswerRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.SurveyAnswers.SurveyAnswerRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISurveyResponseRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.SurveyResponses.SurveyResponseRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ITestActivityRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.TestActivitys.TestActivityRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IScoreProfileRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.ScoreProfiles.ScoreProfileRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="ISwReadinessRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.SoftwareReadiness.SwReadinessRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IIndiaPriorityErrorRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.IndiaPriorityErrors.IndiaPriorityErrorRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IAolRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Aols.AolRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IFMIRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.FMIs.FMIRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IIndiaOCRTrendRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.IndiaOCRTrends.IndiaOCRTrendRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IConsumerInteractionRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.ConsumerInteractions.ConsumerInteractionRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IConsumerInteractionProductSpecificRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.ConsumerInteractionProductSpecifics.ConsumerInteractionProductSpecificRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IMainPageRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.MainPages.MainPageRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IMainPageConsumerInteractionProSpRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.MainConsumerInteractionProSps.MainPageConsumerInteractionProSpRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IMainPageConsumerInteractionRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.MainPageConsumerInteractions.MainPageConsumerInteractionRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IOCRepairRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.OCRepairs.OCRepairRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IOCRSymptomRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.OCRSymptoms.OCRSymptomRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IOCRCategoryDetailsRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.OCRCategoryDetail.OCRCategoryDetailsRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IOCRComponentSymptomRepositoty" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.OCRComponent.OCRComponentSymptomRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IEABRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.EABs.EABRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="URLRootRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.URLRoots.URLRootRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="URLDetailRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.URLDetails.URLDetailRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IQuestionnaireRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Questionnaires.QuestionnaireRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IQuestionnairePageRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.QuestionnairePages.QuestionnairePageRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IQuestionnaireContainerRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.QuestionnaireContainers.QuestionnaireContainerRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IQuestionnaireQuestionRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.QuestionnaireQuestions.QuestionnaireQuestionRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IQuestionnaireQuestionElementRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.QuestionnaireQuestionElements.QuestionnaireQuestionElementRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IQuestionnaireQuestionHistoryRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.QuestionnaireQuestionHistorys.QuestionnaireQuestionHistoryRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IActivitySWRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.ActivitySWs.ActivitySWRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IUFZillaErrorStatusRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.Ufzerrorstat.UFZillaErrorStatusRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      <repositoryMapping interfaceShortTypeName="IOCRDecibelRepository" repositoryFullTypeName="Dashboard.Infrastructure.Repositories.OCRDecibelDetail.OCRDecibelDetailRepository, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    </repositoryMappings>
  </repositoryMappingsConfiguration>
  <entityMappingsConfiguration>
    <entityMappings>
      <entityMapping entityShortTypeName="Site" entityFactoryFullTypeName="Dashboard.Infrastructure.Repositories.Sites.SiteFactory, Dashboard.Infrastructure.Repositories, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
     ...SO ON
  </entityMappingsConfiguration>
  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="500000">
        </jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>
  <system.web>
    <httpRuntime maxRequestLength="2097151" executionTimeout="360" requestValidationMode="2.0" />
    <httpHandlers>
      <add path="*.upload" verb="*" type="JQueryFileUpload.FileUploadHandler"/>
      <add verb="POST"
             path="HighchartsExport.axd"
             type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="POST" path="HighchartsExport.axd" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpHandlers>
    <authentication mode="Windows"/>
    <customErrors mode="Off"/>
    <!--<compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>-->
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages"/>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
我看到过类似的帖子。建议更改IIS的设置。并添加

<add path="*.upload" verb="*" type="JQueryFileUpload.FileUploadHandler"/>

我做了这个…但这不起作用……请建议

MVC:不能通过HttpGet/Post方法访问js文件

您的IIS权限有问题。在IIS 7中默认情况下,网站作为本地系统的网络帐户(NetworkService)运行,而不是作为IIS_User运行。只需将本地用户添加到应用程序池。

<

程序/strong>

重要您必须是本地计算机上Administrators组的成员才能执行以下步骤。作为一项安全最佳实践,请使用不在Administrators组中的帐户登录计算机,然后使用runas命令以管理员身份运行IIS Manager。在命令提示符下,类型

runas /user:Administrative_AccountName "mmc %systemroot%'system32'inetsrv'iis.msc ".

使用IIS管理器

更改应用程序池运行的帐户

1。在IIS管理器中展开本地计算机,展开应用程序池,右键单击应用程序池,然后单击"属性"。

2。单击Identity选项卡,然后单击预定义的或可配置的。预定义是指标准的服务名称,如Network service(默认)、LocalSystem或Local service。可配置指的是已注册的用户名。

•单击"预定义帐号",在列表框中单击预定义帐号。

•如果单击"可配置",请在"用户名"answers"密码"框中输入工作进程运行的用户名和密码。然后将该帐号加入IIS_WPG组。

3。单击OK。

附加链接

https://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/iis/f05a7c2b - 36 - b0 - 4 - b6e ac7c - 662700081 f25.mspx?mfr=true

https://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/iis/12a3d96c ea - 65 - 4210 - 96 -广告- 86 a801f6a88c.mspx?mfr=true