后台
关键字:
权限
邮箱
状态
姓名
积分
--%>
ForeColor="Red" GridLines="None" PageSize="5" AllowPaging="True"
npageindexchanging="GridViewSearchResult_PageIndexChanging" >
NextPageText="下一页" Position="TopAndBottom" PreviousPageText="上一页" /> --%>
DataTextField="Title" HeaderText="标题" />--%>
前台
List field = new List();
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 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()绑定
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12639172/viewspace-608858/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12639172/viewspace-608858/