【发布时间】:2014-01-14 23:33:55
【问题描述】:
我一直试图弄清楚这一点,我看到了许多类似的问题,但不完全是我想要的。
我有一个.php 页面作为父页面,它有一个显示.aspx 页面的iFrame。 我想要做的是:当用户单击 aspx 页面内的按钮时,关闭模态 iframe 并返回到 php 页面。
parent.php
+-------------------------------------------+
| |
| |
| "survey" |
| CloseSurvey() |
| +--------------------------+ |
| | | |
| | | |
| | child.aspx | |
| | +---------------+ | |
| | | | | |
| | | btnClose | | |
| | | | | |
| | | | | |
| | | | | |
| | +---------------+ | |
| | | |
| | | |
| +--------------------------+ |
| |
+-------------------------------------------+
void btnClose_Click(object sender, EventArgs e)
{
//Close iframe
}
我试过了
ClientScript.RegisterStartupScript(typeof(Page), "CLOSEWINDOW", "parent.CloseSurvey()");
它什么也没做。没有错误,也不会关闭。
我一直在试图弄清楚如何在 parent 中调用该方法,但我仍然无法弄清楚。
如何从 child.aspx 关闭模态 iframe 弹出窗口??
【问题讨论】:
标签: javascript php asp.net iframe