查询邪门问题
是实现查询 在textBox 里输入内容后 点击 Enter为什么会自动返回到首页,而不进行性查询,
protected void btn_Click(object sender, EventArgs e) { if (null != this.title.Text.Trim().ToString() && !"".Equals(this.title.Text.Trim().ToString())) { string sql = "select * from Notices where title like '%" + this.title.Text + "%' order by date desc"; } this.title.Attributes.Add("onkeydown", "if(event.keyCode==13)event.keyCode=9"); NoticeMessage noticeMessage = new NoticeMessage(); this.DataList1.DataSourceID = ""; this.DataList1.DataSource = noticeMessage.getTitle(sql); this.DataList1.DataBind(); }