我用Repeater做了分页,如果不加搜索的话是正常的 
由于数据比较多,后来我在此页面加了一个搜索框, 
<asp:TextBox   id=Keyword   runat= "server "> </asp:TextBox> 
如果网页第一次加载,且我不按下一页的时候,搜索功能是正常能用的. 
如果我按了下一页或者下一页,搜索功能搜出来的就是空的. 
我想应该是数据绑定的问题,所以请教应该如何重新绑定,或者帮我看看是不是这个问题.新人手上没分,请原谅 
以后是我代码.    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookies = Request.Cookies["oUserName"];
        if (cookies == null)
        {
            Response.Redirect("Close_Cookies.aspx");
        }
databind();    }   private void databind()
    {
        try
        {
string url="Ks_manage.aspx",sql;
//string urlstr = "Keyword='+Keyword+'";
            sql = "select * from ks_content where id <> 0";
if (this.Keyword.Text != "")
{
sql =sql+" and title like '%"+this.Keyword.Text+"%'";
}
            SqlConnection conn = DB.conn();
            SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
            conn.Open();
            DataSet ds = new DataSet();
            sda.Fill(ds, "table");
PagedDataSource objpage = new PagedDataSource();
objpage.DataSource = ds.Tables["table"].DefaultView;
objpage.AllowPaging = true;
objpage.PageSize = 12;
int curPage;
if (Request.QueryString["Page"] != null)
curPage = Convert.ToInt32(Request.QueryString["Page"]);
else
curPage = 1;
objpage.CurrentPageIndex = curPage - 1;
this.Label1.Text = "当前页:第" + curPage.ToString() + "页";
this.Label2.Text="共"+objpage.PageCount+"页";
if (!objpage.IsFirstPage)
{
this.HyperLink3.NavigateUrl = url + "?page=1";
this.HyperLink1.NavigateUrl=url+"?page="+Convert.ToInt32(curPage-1)+"";
}
if (!objpage.IsLastPage)
{
this.HyperLink2.NavigateUrl=url+"?page="+Convert.ToInt32(curPage+1)+"";
this.HyperLink4.NavigateUrl=url+"?page="+Convert.ToInt32(objpage.PageCount)+"";
}
            this.Repeater1.DataSource = objpage;
            this.Repeater1.DataBind();
            conn.Close();
        }
        catch (Exception e)
        {
throw new Exception(e.ToString());
        }
    }