模块一:
在子页面的选择按钮事件中加上:
1.this.Response.Write("<script>window.opener.location.href=window.opener.location.href;window.close();</script>");
this.Response.Write("<script>window.opener.location.replace(window.opener.document.referrer);window.close();</script>");
2. Response.Write("<script language:javascript>javascript:window.close();</script>");
this.Response.Write("<script>window.opener.location.reload(); </script>");
用第一种方法时会出现不能正确返回到它的父页面,可能会转到父页面的浏览之前的页面
模块二:
父页面:
HyperLink Print = e.Item.Cells[e.Item.Cells.Count - 1].Controls[0] as HyperLink;
Print.Text = "操作";
string script = string.Format("javascript:window.showModalDialog(encodeURI('FixtureUpd.aspx?panelid=" + panelid + "&paneladdr=" + paneladdr + "&panelname=" + panelname + "'),window,'dialogWidth=300px;dialogHeight=100px;center=yes;scroll=no;status=no;')");
Print.Attributes.Add("href", script);
子页面:
Response.Write("<script language=javascript>");
Response.Write("alert('修改成功!');");
Response.Write("window.dialogArguments.location.href=window