静态列表分页(能解决的。100分,全给了)在线等待!!!
生成单个静态页面,我会
生成一个静态列表,我也会
但静态文章列表分页,我就不会了,我用的是C#,思路会,但就做不出来,有做过,给个源码也行,贴出代码也行,谢谢了,我都做了一个国庆了,也没搞出来,郁闷。在线等!!
------解决方案--------------------吗的 回复不了,显示超时,哎!!
------解决方案--------------------如果是静态网页的文章分页,那你算找对人了。找我
决对OK。QQ:29436649
------解决方案--------------------有思路了就行了,其实方法跟单页列表差不多,只不过是筛选的语句不一样而已。
打个比方选取10条记录每页
如第一页 select top 10 id from A
第n页就要 select top 10 id from A where id not in (select top (n-1)*10 id from A)
生成静态页面是页码也要加个n
------解决方案--------------------用JS来实现比较好
========================
提供以下js分面代码
<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="[url]http://www.w3.org/1999/xhtml[/url]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title> JavaScript: showPages v1.0 [by Lapuasi.com]</title>
<script language="JavaScript">
<!--
/*
showPages v1.1
=================================
Infomation
----------------------
Author : Lapuasi
E-Mail : [email]lapuasi@gmail.com[/email]
Web : [url]http://www.lapuasi.com[/url]
Date : 2005-11-17
Example
----------------------
var pg = new showPages('pg');
pg.pageCount = 12; //定义总页数(必要)
pg.argName = 'p'; //定义参数名(可选,缺省为page)
pg.printHtml(); //显示页数
Supported in Internet Explorer, Mozilla Firefox
*/
function showPages(name) { //初始化属性
this.name = name; //对象名称
this.page = 1; //当前页数
this.pageCount = 1; //总页数
this.argName = 'page'; //参数名
this.showTimes = 1; //打印次数
}
showPages.prototype.getPage = function(){ //丛url获得当前页数,如果变量重复只获取最后一个
var args = location.search;
var reg = new RegExp('[\?&]?' + this.argName + '=([^&]*)[&$]?', 'gi');
var chk = args.match(reg);
this.page = RegExp.$1;
}
showPages.prototype.checkPages = function(){ //进行当前页数和总页数的验证
if (isNaN(parseInt(this.page))) this.page = 1;
if (isNaN(parseInt(this.pageCount))) this.pageCount = 1;
if (this.page < 1) this.page = 1;
if (this.pageCount < 1) this.pageCount = 1;
if (this.page > this.pageCount) this.page = this.pageCount;
this.page = parseInt(this.page);
this.pageCount = parseInt(this.pageCount);
}
showPages.prototype.createHtml = function(mode){ //生成html代码
var strHtml = '', prevPage = this.page - 1, nextPage = this.page + 1;
if (mode == '' || typeof(mode) == 'undefined') mode = 0;
switch (mode) {
case 0 : //模式1 (页数,首页,前页,后页,尾页)
strHtml += '<span class="count">Pages: ' + this.page + ' / ' + this.pageCount + '</span>';
strHtml += '<span class="number">';
if (prevPage < 1) {
strHtml += '<span title="First Page">?</span>';
strHtml += '<span title="Prev Page">?</span>';
} else {
strHtml += '<span title="First Page"><a href="javascript:' + this.name + '.toPage(1);">?</a></span>';
strHtml += '<span title="Prev Page"><a href="javascript:' + this.name + '.toPage(' + prevPage + ');">?</a></span>';
}
for (var i = 1; i <= this.pageCount; i++) {
if (i > 0) {
if (i == this.page) {
strHtml += '<span titl