AspNetPager 新闻内容分页
来源:互联网 发布:仿三菱plc源码书籍 编辑:程序博客网 时间:2024/05/09 02:05
前台:
<%if (YesIsNoPage)
{%>
<webdiyer:AspNetPager ID="AspNetPager" CssClass="paginator" CurrentPageButtonClass="cpb"
runat="server" AlwaysShow="True" FirstPageText="Home" LastPageText="End" NextPageText="Next"
PageSize="1" PrevPageText="Previous" OnPageChanged="AspNetPager_PageChanged"
CustomInfoTextAlign="Center" LayoutType="Table" ShowPageIndex="false" CustomInfoHTML="Current: %CurrentPageIndex%/%PageCount% Pages"
PageIndexBoxType="TextBox" ShowCustomInfoSection="Left" ShowPageIndexBox="Never">
</webdiyer:AspNetPager>
<% } %>
后台:
protected static string ProductsText;
protected static bool YesIsNoPage;
protected static string strContent;
protected void Products_load()
{
string text = ProductsText;
//查找分页符并替换html标签
string StringB = "<div style=\"page-break-after: always\"> <br /> <span style=\"display: none;\"> </span></div>"; text = text.Replace("\n\t", "");
text = text.Replace("\n", "<br />");
text = text.Replace("\r", " ");
string[] strLined = text.Split(new string[] { StringB }, StringSplitOptions.RemoveEmptyEntries);
string tempString = null;
this.AspNetPager.RecordCount = strLined.Length;
int PageSize = this.AspNetPager.PageSize;
int PageIndex = this.AspNetPager.CurrentPageIndex;
//判断是否显示分页控件
if (strLined.Length > 1)
YesIsNoPage = true;
else
YesIsNoPage = false;
//判断是否启动分页
int JudgeYesPage = strLined.Length / PageSize + 1;
int JudgeNoPage = strLined.Length;
if (this.AspNetPager.CurrentPageIndex != JudgeYesPage)
{
for (int i = (PageIndex - 1) * PageSize; i < PageSize * PageIndex; i++)
{
tempString += strLined[i] + "<br />";
}
strContent = tempString;
}
else
{
for (int i = (PageIndex - 1) * PageSize; i < JudgeNoPage; i++)
{
tempString += strLined[i] + "<br />";
}
strContent = tempString;
}
}
protected void AspNetPager_PageChanged(object sender, EventArgs e)
{
Products_load();
}
- AspNetPager 新闻内容分页
- 新闻内容分页
- .net 新闻内容分页
- fckeditor2.5.1+aspnetpager实现内容分页
- fckeditor2.5.1+aspnetpager实现内容分页
- 牛腩新闻发布系统--分页学习(AspnetPager控件)
- PHP新闻内容分页类
- AspNetPager分页
- AspNetPager分页
- AspNetPager分页
- AspNetPager 分页
- AspNetPager 分页
- aspnetpager分页
- AspNetPager分页
- aspnetpager分页
- AspNetPager分页
- AspNetPager 分页
- C#新闻内容过长,内容分页
- apk签名后,优化。
- DevExpress技术社区正式开放!
- CIRCOS教程翻译 5.1——Drawing Basic Links
- JDBC连接数据库的步骤
- virtual box 共享文件夹
- AspNetPager 新闻内容分页
- sql server 2008 使用 for xml path 实现类似 oracle 的 concat 函数
- 有hadoop的Live Nodes为1引起的思考
- 局域网内无法连接到远程SQL服务器
- dataguard参数文件笔记
- Win7安vc2008编译报LNK1000错误解决方法
- JSTL 核心标签库 使用
- java操作mongodb的那些事
- jfinal异常