一个分页控件

作者:袖梨 2022-07-02
pager.ascx
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="pager.ascx.cs" Inherits="Web.pagercontrol" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
var currentpage=<%=pageindex%>;//当前第几页
var p=<%=pageindex%>-1;
var sum=<%=sum%>;
var perpage=<%=perpage%>;
var urlstr='<%=urlstr%>';
var fontcolor='<%=fontcolor%>';
//n代表一共有多少页
if(sum%perpage==0)
{
n=sum/perpage;
}
else
{
n=(sum-sum%perpage)/perpage+1;
}
document.write ('');
document.write ('');
document.write ('');
document.write ('
');
document.write ('页次:'+currentpage+' / '+n+ '页 每页'+perpage+' 共计: '+sum+' 条数据
分页:');
if (currentpage==1)
{
document.write ('9');
}
else
{
document.write ('9');

相关文章

精彩推荐

一聚教程网

Copyright © 2010-2022

111cn.net All Rights Reserved