拒绝在框架中显示'',因为它将'X-Frame-Options'设置为'SAMEORIGIN'

SNT*_*SNT 0 c# asp.net-mvc iframe

我做了一个MVC ASP.NET C#项目,主要是一个表单.

但是当我iframe正确的url时,它显示为空白

注意:我没有做任何关于iframe的代码

我需要打开一个选项才能使iframe成为可能吗?

FirefoxConsole Error message:

Load denied by X-Frame-Options: http://localhost:2053/Persons/Create does not permit cross-origin framing.

 Chrome Error message: 

  Refused to display 'http://localhost:2053/Persons/Create' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. 
Run Code Online (Sandbox Code Playgroud)

SNT*_*SNT 12

找到了解决方案:将其添加到global.asax.cs

  protected void Application_PreSendRequestHeaders()
    {
        Response.Headers.Remove("X-Frame-Options");
         Response.AddHeader("X-Frame-Options", "AllowAll");

    }
Run Code Online (Sandbox Code Playgroud)