【问题标题】:Post a data to iframe(aspx) to capture it in Page load of aspx page将数据发布到 iframe(aspx) 以在 aspx 页面的页面加载中捕获它
【发布时间】:2015-06-01 13:59:50
【问题描述】:

我有一个 HTML 页面和一个 iframe(aspx 页面),如下所示。

Mypage.htm

<div>
<iframe name="Frame1" id="ff1" src="http://example.com/example.aspx" frameborder="0" scrolling="no" height="600" width="500" style="text-decoration:none;" marginwidth="5"></iframe>
</div>

此 Mypage.htm 将作为来自其他页面的链接提供,用户点击后 Mypage.htm 在新选项卡中打开。

我想将数据发布到 iframe。发布的数据是“网站”=“真”(发布的数据只是一个标识,是固定的)。发布的数据在 iframe 中的 aspx 页面的 page_load 中捕获。

所以现在我很困惑如何将数据发布到框架以及在哪个事件中。我应该能够在 aspx 页面的页面加载中获取发布的数据。 如何做到这一点。

【问题讨论】:

    标签: javascript jquery html asp.net iframe


    【解决方案1】:

    只需使用查询字符串而不是发布数据:

    <div>
        <iframe name="Frame1" id="ff1" src="http://example.com/example.aspx?website=true" frameborder="0" scrolling="no" height="600" width="500" style="text-decoration:none;" marginwidth="5"></iframe>
    </div>
    

    Page_Load 中检查Request.QueryString["website"](而不是Request.Form["website"])。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-16
    • 2021-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多