在Gridview控件的RowCommand事件里写
if (e.CommandName == "unBd")
{
string id = e.CommandArgument.ToString();
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "var width=Math.round((window.screen.width-380)/2);var height=Math.round((window.screen.height-150)/2);window.open('UnBanding.aspx?id=" + id + "&t=v','unbing','height=150, width=380, top='+height+', left='+width+', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');", true);
}
/在子窗体里,完成一些操作后,关闭子窗体,同时刷新父页面,子页面要加上 <base target="_self" />
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "window.alert('操作成功!');window.opener.location.href=window.opener.location.href;window.close();", true);