【发布时间】:2011-04-28 19:41:00
【问题描述】:
我有一个不断刷新的页面,我想将该页面包含到我的主页中。
我正在使用 iframe 将页面包含到我的主页中,但每次刷新 iframe 中的页面时,它也会刷新我的主页。如何让 iframe 在自己的框架内刷新而不影响我的主页?
或者有没有更好的方法在不使用 iframe 的情况下包含页面?
【问题讨论】:
我有一个不断刷新的页面,我想将该页面包含到我的主页中。
我正在使用 iframe 将页面包含到我的主页中,但每次刷新 iframe 中的页面时,它也会刷新我的主页。如何让 iframe 在自己的框架内刷新而不影响我的主页?
或者有没有更好的方法在不使用 iframe 的情况下包含页面?
【问题讨论】:
document.frames["myInnerFrame"].location.href=fl;
http://www.hotscripts.com/forums/javascript/15955-javascript-command-refresh-iframe-content.html
【讨论】:
如果您需要从页面后面的 asp.net 代码刷新父页面,您只需注册客户端脚本以在页面加载时运行:
protected void btnOk_Click(object sender, EventArgs e)
{
//Implement Your logic here.....
//..............................
//now refresh parent page and close this window
string script = "this.window.opener.location=this.window.opener.location;this.window.close();";
if (!ClientScript.IsClientScriptBlockRegistered("REFRESH_PARENT"))
ClientScript.RegisterClientScriptBlock(typeof(string), "REFRESH_PARENT", script, true);
}
How to refresh parent page on child window close 的逐步教程说明了上述函数的使用。
【讨论】:
【讨论】: