后台

<div />
        </asp:GridView> 
      </ContentTemplate>

 

前台

 

 List<string> field = new List<string>();
    protected void Page_Load(object sender, EventArgs e)
    {


        //加载CSS样式表
        WebLoader.LoadCSS(this, "BasicStyle.css");
        WebLoader.LoadCSS(this, "Search.aspx.css");

        field.Add("User_Status");
        field.Add("User_Email");
        field.Add("User_State");
        field.Add("User_RealName");
        field.Add("User_Point");

        if (!Page.IsPostBack)
        {
            this.Bind();   //调用上面的BindToGridView()绑定
        }
    }

    protected void Bind()
    {
        IUserBLL userBLL = BLLFactory.CreateUserBLL();
        IList<UserInfo> result = userBLL.GetByFieldAndPage(field[DropDownListField.SelectedIndex], this.tbKeyword.Text.Trim(), 1, 10);


        this.GridViewSearchResult.DataSource = result;
        this.GridViewSearchResult.DataBind();
    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        Bind();
       

    }


    protected void GridViewSearchResult_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridViewSearchResult.PageIndex = e.NewPageIndex;
        this.Bind();   //调用上面的BindToGridView()绑定
    }

 

相关文章:

  • 2021-09-08
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2021-10-15
猜你喜欢
  • 2021-09-25
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
相关资源
相似解决方案