MasterPage.master

<div />
    </center>
  </div>
</div>

MasterPage.master.cs

protected void btn_search_Click(object sender, EventArgs e)
  {
    Response.Redirect("~/search.aspx?str_search_key_word=" + this.text_search.Text.ToString());
  }

search.aspx.cs

SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["db_kaoyanConnectionString"].ConnectionString);

SqlCommand cmd_english = new SqlCommand("select [id],[guid],[category],[title],[date] from article WHERE ([title] LIKE '%" + Request.QueryString["str_search_key_word"] + "%') ORDER BY [date] DESC", conn);

SqlDataAdapter da_english = new SqlDataAdapter(cmd_english);

DataSet ds_english = new DataSet();

 

摘自http://hi.baidu.com/%B4%F3%CE%B0/blog/item/754e6259029144202934f04f.html

相关文章:

  • 2022-01-22
  • 2022-12-23
  • 2021-08-09
  • 2021-12-30
  • 2021-06-29
  • 2021-10-21
  • 2022-12-23
  • 2021-12-16
猜你喜欢
  • 2021-12-23
  • 2021-09-08
  • 2021-08-11
  • 2021-06-17
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案