当iframe中的控件触发click事件时,如何在iframe内重新加载aspx页面

how to reload an aspx page within an iframe when click event triggers from the control within an iframe

本文关键字:iframe 新加载 加载 页面 aspx 控件 click 事件      更新时间:2023-09-26

我有一个网页,其中有一个iframe,我正在加载一个单独的网页.aspx,比如wb2.aspx。wb2.aspx中有一个名为添加注释的按钮。单击该按钮时,将出现一个模式弹出窗口,它接受一些值并将其存储在数据库中。我在wb2.aspx中显示评论。现在我的意图是在添加评论后不久,页面必须刷新,并且新输入的评论必须可见。我该怎么做?

经过长时间的搜索,我得到了这个答案。。

string script = "this.window.parent.location=this.window.parent.location;this.window.close();";
        if (!ClientScript.IsClientScriptBlockRegistered("REFRESH_PARENT"))
            ClientScript.RegisterClientScriptBlock(typeof(string), "REFRESH_PARENT", script, true);