button的事件
if(TextBox2.Text!=null&&TextBox3.Text!=null)
{
try
{
luntan luntan = new luntan();
luntan.content = TextBox3.Text;
luntan.title = TextBox2.Text;
luntan.pId = TextBox1.Text;
luntan.dateOf = DateTime.Now.Date;
luntan.picAddress=picstr;
DataClassesDataContext dcdc = new DataClassesDataContext();
dcdc.luntan.InsertOnSubmit(luntan);
dcdc.SubmitChanges();
点击了确定以后
TextBox3.Text = null;
TextBox2.Text = null;
// TextBox1.Text = null;
Response.Redirect("Default4.aspx");
为什么if没起到限制作用,是因为textbox值不为空吗??解决办法是什么。