zoukankan      html  css  js  c++  java
  • [网络收集]按标题进行站内搜索

    MasterPage.master

    <div id="menu_search">
      <span class="item_title">文章搜索</span>
      <div id="menu_search_info" class="item_info">
        <center>
          <asp:TextBox ID="text_search" Width="156px" runat="server" MaxLength="20" />
          <asp:Button ID="btn_search" Text="搜索" runat="server" UseSubmitBehavior="true" onclick="btn_search_Click" />
        </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

  • 相关阅读:
    Webpack安装及基础配置
    相机拍到了光源的灯珠图像
    面向对象特殊用法
    面向对象初始
    内置函数和必须的模块
    模块基本模式
    函数三
    函数二
    装饰器
    函数初识
  • 原文地址:https://www.cnblogs.com/lushuicongsheng/p/1890608.html
Copyright © 2011-2022 走看看