小豆岛交通:这两段代码怎么不能同时放在Page_load事件中

来源:百度文库 编辑:神马品牌网 时间:2024/04/25 16:47:33
this.btn_CcrSelect.Attributes.Add("onclick","window.open('ccrSelect.aspx?','ccrSelectWindow', 'height=500, width=450, top=150,left=300, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no,status=no')");

this.btn_DigitalSignature.Attributes.Add("onclick","window.open('digitalSignature.aspx?','digitalSignatureWindow','height=400,width=450,top=150,left=300,toolbar=no,menubar=no,scrollbar=no,resizable=no,location=no,status=no')");
点击其中的一个按钮,能弹出一个页面。然后再点另一个,所有的页面就都关闭,为什么?
private void Page_Load(object sender, System.EventArgs e)
{
this.btn_CcrSelect.Attributes.Add("onclick","window.open('ccrSelect.aspx?','ccrSelectWindow', 'height=500, width=450, top=150,left=300, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no,status=no');");
this.btn_DigitalSignature.Attributes.Add("onclick","window.open('digitalSignature.aspx?','digitalSignatureWindow','height=400,width=450,top=150,left=300,toolbar=no,menubar=no,scrollbar=no,resizable=no,location=no,status=no');");
this.btnClose .Attributes .Add ("onclick","window.close();");
}
没有第三句就没有错误

这样
this.btnClose.Attributes.Add ("onclick","window.close()");

你的语句里有2个多余的空格!