asp

位置:IT落伍者 >> asp >> 浏览文章

AspNetPager分页


发布日期:2020年10月16日
 
AspNetPager分页

前台

代码

<webdiyer:AspNetPager ID=AspNetPager runat=server BackColor=#EEEEEE

CenterCurrentPageButton=True

CustomInfoHTML=共%PageCount%页当前为第%CurrentPageIndex%页每页%PageSize%条

FirstPageText=首页 LastPageText=尾页 NextPageText=下一页

onpagechanging=AspNetPager_PageChanging PageIndexBoxType=DropDownList

PageSize= PrevPageText=上一页 ShowCustomInfoSection=Left

ShowPageIndexBox=Always SubmitButtonText=Go TextAfterPageIndexBox=

TextBeforePageIndexBox=转到>

</webdiyer:AspNetPager>

后台

代码

protected void Page_Load(object sender EventArgs e)

{

if (!IsPostBack)

{

Bind();

}

}

public void Bind()

{

user l = new user();

List<user> m = lGetList();

AspNetPagerRecordCount = mCount;

PagedDataSource pds = new PagedDataSource();

pdsAllowPaging = true;

pdsPageSize = AspNetPagerPageSize;

pdsCurrentPageIndex = AspNetPagerCurrentPageIndex ;

pdsDataSource = m;

grdY_userDataSource = pds;

grdY_userDataBind();

}

protected void AspNetPager_PageChanging(object src WuqiWebdiyerPageChangingEventArgs e)

{

thisAspNetPagerCurrentPageIndex = eNewPageIndex;

Bind();

}

上一篇:以 Cassini 来宿主 ASP. NET 客户端

下一篇:关于asp中转化时间为数字、字符串