【问题标题】:Single Page App won't show up in iframe on a asp.net web app单页应用程序不会显示在 asp.net 网络应用程序的 iframe 中
【发布时间】: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


【解决方案1】:

我想通了。您需要在 src.xml 中指定 SPA 的启动页面。我仍然不确定为什么它不能直接进入启动页面。

【讨论】:

    猜你喜欢
    • 2013-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-19
    • 2015-07-19
    • 2016-03-28
    • 1970-01-01
    相关资源
    最近更新 更多