通过button事件判断textbox1和2是否为空,但我输入了用户名和密码也执行if语句,Label1和2仍然显示,求解
protected void Button2_Click(object sender, EventArgs e)
    {        if (TextBox1.Text == "")
        {
            Label1.Text = "用户名不能为空";
            
        }        if (TextBox2.Text== "")
        {
            Label2.Text = "密码不能为空";
           
        }    }