关闭弹出窗口后如何运行功能?
这是我的按钮单击,以打开弹出窗口:
ImageButton btnEdit = (ImageButton)sender;
GridViewRow row = (GridViewRow)btnEdit.NamingContainer;
string url;
url = "Add-Bank.aspx?a=E&id=" + txtEmployeeCode.Text.Trim() + "&acc=" +
((HiddenField)row.FindControl("hidRecID")).Value;
Response.Write("<script>window.open('" + url + "',400,600);</script>");
在我的弹出窗口中,关闭按钮代码为:
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", "window.close()", true);
当我关闭弹出窗口时,如何运行特定功能或按钮单击事件?
到目前为止,我尝试过的 我甚至创建了一个名为btnRefresh的点击:
protected void btnRefresh_Click(object sender, EventArgs e)
{
LoadData();
}
我尝试从弹出窗口中运行此事件,但未按以下方式触发该事件:
<script type="text/javascript">
$(document).ready(function () {
var cpframe = top.document.getElementById('contframe');
if (cpframe) {
cpframe.contentWindow.document.getElementById('Main_btnRefresh').click();
}
});
</script>
提前谢谢。