你好朋友我写了一个在新窗口中打开一个aspx页面的代码。但是,当我第一次单击页面按钮时,它不会打开窗口,但之后每次单击时它都会打开。我的意思是说第一次单击asp.net中的按钮时没有打开窗口这是我的代码
protected void Button1_Click(object sender, EventArgs e)
{
Button1.OnClientClick =
"window.open('ezychat/frmchathome.aspx?FromUserId=" +Session["User_userid"] +
"&Username=" + Session["User_username"] +
"&IsReply=yes','','width=400,height=200,scrollbars=no,toolbars=no,titlebar=no,menubar=no'); isLostFocus = 'true';";
}
请告诉我为什么会这样