美文网首页全栈开发技术
解决嵌入Asp.NET MVC页面提示“because it s

解决嵌入Asp.NET MVC页面提示“because it s

作者: felix1982 | 来源:发表于2017-07-11 21:55 被阅读93次

    ASP.NET MVC5会自动在HTTP响应头中添加X-Frame-Options 为‘SAMEORIGIN‘,导致了问题的产生
    解决方法很简单,
    在Application_Start中可以关闭这个功能:
    protected void Application_Start()
    {
    AntiForgeryConfig.SuppressXFrameOptionsHeader = true;
    }

    相关文章

      网友评论

        本文标题:解决嵌入Asp.NET MVC页面提示“because it s

        本文链接:https://www.haomeiwen.com/subject/wwfvhxtx.html