【发布时间】:2015-06-03 14:09:52
【问题描述】:
我正在尝试让单页应用程序显示在单独的 asp.net Web 应用程序的 iframe 中。
除了单页应用程序之外,我几乎可以在 iframe 中显示任何其他内容。这都是为了测试当前正在使用的 Web 应用程序,所以我必须这样做。
这是html:
<iframe name="frameMain" width="800" height="450" src="http://localhost:51219 ">
</iframe>
当我调试它时,我得到一个 403 禁止错误。
【问题讨论】:
-
检查应用程序的 x-frame-options 标头,这将阻止它在 iFrame 中呈现。
-
我在 web.config 中没有看到 x-frame-options 标头。我尝试设置 x-frame 选项以允许来自我的 Web 应用程序。还是一样的错误。
-
您是否定义了默认页面?也许它正在尝试枚举根目录。
标签: javascript c# asp.net asp.net-mvc iframe