日期:2014-05-17 浏览次数:20505 次
if (TextBox1.Text == "")
{
Response.Write("<script>window.alert('请输入')</script>");
}
else
{
if (DropDownList1.SelectedValue.ToString() == "作者")
{
Session["b_name"] = this.TextBox1.Text;
}
else if (DropDownList1.SelectedValue.ToString() == "书名")
{
Session["b_zz"] = this.TextBox1.Text;
}
else if (DropDownList1.SelectedValue.ToString() == "ISBN")
{
Session["b_ISBN"] = this.TextBox1.Text;
}
Response.Redirect("Default5.aspx");
}
string strsql = "";
strsql = "SELECT * FROM Book WHERE 1=1";
if (Session["b_name"] != "")
{
strsql += " AND bookName like'%" + Session["b_name"].ToString() + "%' ";
}
if (Session["b_zz"] != "")
{
strsql += " AND author like'%" + Session["b_zz"].ToString() + "%' ";