简体   繁体   English

MVC收到HTTP错误403.14-禁止第二次打开视图

[英]MVC Getting HTTP Error 403.14 - Forbidden second time opening view

I have started to get an unusual error starting this week when requesting one specific view in my project. 从本周开始,在我的项目中请求一个特定视图时,我开始出现异常错误。 I have a cshtml file (partial view and controller function only contains a single line for returning the view) and it used to work fine but now if I access it twice I get an 403.14 error code, restarting the computer doesnt help. 我有一个cshtml文件(部分视图和控制器功能仅包含用于返回视图的一行),它曾经可以正常工作,但是现在如果我两次访问它,我将收到403.14错误代码,重新启动计算机无济于事。 None of the other files in the same controller / folder have any problem. 同一控制器/文件夹中的其他文件均没有任何问题。

Yesterday I tried to rename the view multiple times and after renaming it worked once but if I refreshed the page I got the error again. 昨天,我尝试多次重命名视图,并且在重命名后可以使用一次,但是如果刷新页面,则会再次出现错误。

I asked a friend to download the source code and see if he had the same problem and he could open it up multiple times. 我请一个朋友下载源代码,看看他是否有同样的问题,他可以多次打开它。

Have anyone else had this problem? 还有其他人有这个问题吗?

The version of MVC is: 5.2.3 MVC的版本是:5.2.3

Controller: 控制器:

public class HomeController : Controller
{
   public ActionResult CreateCaseModal()
   {
      return PartialView();
   }
}

View: 视图:

<div class="modal-header">
  <h3 class="modal-title">Create case</h3>
</div>
<div class="modal-body">
    <div class="form-group" ng-if="modalVM.showOrganizations">
        <label>Organization</label>
        <select class="form-control">
            <option>Organization 1</option>
            <option>Organization 2</option>
            <option>Organization 3</option>
        </select>
    </div>
    <div class="form-group"  ng-if="modalVM.showTypeOfInjuries">
        <label>Type of injury</label>
        <select class="form-control">
            <option>Org 1</option>
            <option>Org 2</option>
            <option>Org 3</option>
        </select>
    </div>
    <div class="form-group">
        <label>Case number</label>
        <input type="text" class="form-control"/>
    </div>
</div>
<div class="modal-footer">
    <button class="btn btn-primary" ng-click="modalVM.create()">Create</button>
    <button class="btn btn-warning" ng-click="modalVM.cancel()">Cancel</button>
</div>

Try adding this to your web.config file 尝试将其添加到您的web.config文件中

<system.webServer>
 <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM