非模态刷新父页面:window.opener.location.reload(); 模态刷新父页面:window.dialogArguments.location.reload(); Response.Write(script language=javascriptrn); Response.Write(!--rn); Response.Write(if(dialogArguments != null) {rn
非模态刷新父页面:window.opener.location.reload();
模态刷新父页面:window.dialogArguments.location.reload();
Response.Write("<script language="javascript">rn");
Response.Write("<!--rn");
Response.Write("if(dialogArguments != null) {rn");
// 注意上面的dialogArguments,就是父页面showModalDialog()的第二个参数。
// 就是父页面的window对象引用。
Response.Write("dialogArguments.location.reload(true);rn");
// 上面就是刷新父页的代码,相当于在父页上使用
// window.location.reload(true);代码
Response.Write("window.close();}"); // 关闭对话框
Response.Write("//-->rn</script>"); //关闭脚本块
}
上面的代码就是关闭对话框和刷新父页的代码,这段代码也可以直接写入editdata.aspx的html中,然后在后台cs中调用