Refresh iframe without refreshing the parent page

谁都会走 提交于 2019-12-06 08:57:50

If you need to refresh the parent page from asp.net code behind page, you can just register client script to run on page load:

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);          
    } 

The stepwise tutorial on How to refresh parent page on child window close illustrates the use of the above function.

I have a solution:

HERE

This actually reloads an iframe every 3 seconds, but it can be easily tailored to your needs for a 1-time reload since the basic principals apply...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!