对象为空为什么If语句还会执行??
else if (!IsPostBack)
{
userInfor user = new userInfor();
string name = user.getUserName(Convert.ToInt32(Session["userid"]));
Session["name"] = name;
BLL.OutNoteBLL on = new BLL.OutNoteBLL();
OutNote outNote = on.getOutNoteByName(name);
if (outNote != null)在执行时此对象为空但是为什么还会执行下面的语句呢
{
this.txtCompany.Text = outNote.WCompany;
this.ddlCompany.DataSourceID = "";
this.txtConnPeople.Text = outNote.WConnPeople;
this.txtPhone.Text = outNote.ConnPhone;
this.btnOut.Enabled = false;
btnBack.Enabled = true;
}
else
{
btnBack.Enabled = false;
btnOut.Enabled = true;
}
}