求解:为什么关闭模态窗口时会另外打开一个新页面
请教各位大侠,问题如下:
弹出模态窗口
LinkButton btDatail = (LinkButton)e.Row.Cells[0].Controls[0]; string infoID = this.GridView1.DataKeys[e.Row.RowIndex].Values["userID"].ToString(); btDatail.Attributes.Add("onclick", "javascript:var s=window.showModalDialog('admin_jianli.aspx?infoID=" + infoID + "',window,'dialogwidth:800px;dialogheight:600px;help:0;resizable:yes;status:0;scroll:yes');if(s==1) location.href='Default.aspx'"); protected void Button1_Click(object sender, EventArgs e){//更新数据的代码,然后关闭弹出窗口ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>window.close();</script>"); }