| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1900 人关注过本帖
标题:我很想了解静态分页的原理
取消只看楼主 加入收藏
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
 问题点数:0 回复次数:4 
我很想了解静态分页的原理
静态分页加上反向分页,
有哪位高手愿意共享给小弟的.
我想要知道原理
!!!!!
搜索更多相关主题的帖子: 静态 原理 
2005-11-04 17:12
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 
很多网站的静态分页是这样的,每次生成一个静态页面后,他自已加到分页里面,不用重新生成所有 的HTML,叫什么反向分页


动网管理系统好像有,下个研究一下...

中国人的财富网:http://www..cn/
2005-11-05 12:30
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 

生成分页,
是不是每个页面都是重新从数据库中读取数据,然后有用FSO+模板,一页面一页面的生成.
最后分页自已根据生成的结果来进得显示分页总数.等等,
不知道是不是这样子的.


中国人的财富网:http://www..cn/
2005-11-05 18:58
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 
<!--#include file="articleconn.asp"-->
<%
IF Session("KEY")<>"super"THEN
response.redirect "mymanage.asp"
response.end
END IF
TypeItem=request("ItemName")
set rs=server.CreateObject("Adodb.Recordset")
sql="select * from type where typename='"&TypeItem&"'"
rs.open sql,conn,1,1
Type_Fold=rs("typename")
Type_Name=rs("type")
Type_index=rs("TypeIndex")
if rs.eof then
Response.Write("没有此栏目")
else
set rs_up=server.CreateObject("Adodb.recordset")
sql_up="select * from type"
rs_up.open sql_up,conn,1,1
i=1
do while not rs_up.eof
Menu=Menu&"<a href=../"&rs_up("typename")&"/"&rs_up("typeindex")&">"&rs_up("type")&"</a><font color='#0099FF'><b>—</b></font>"
i=i+1
rs_up.movenext
loop
rs.close
rs_up.close
TypeContent_sql="select * from article where typename='"&Type_Name&"'"
rs.open TypeContent_sql,conn,1,1
if rs.eof then
TypeContent=TypeContent&"此栏目暂时没有任何内容"
else
const MaxPerPage=3
rs.pagesize=MaxPerPage
CurrentPage=request("PageNo")
if CurrentPage="" then
CurrentPage=1
elseif CurrentPage<1 then
CurrentPage=1
else
CurrentPage=clng(CurrentPage)
if CurrentPage>rs.pagecount then
CurrentPage=rs.pagecount
end if
end if
if not isnumeric(CurrentPage) then
CurrentPage=1
end if
Totalput=rs.recordcount
if Totalput mod MaxPerPage=0 then
n=Totalput\MaxPerPage
else
n=Totalput\MaxPerPage+1
end if
if n=0 then
n=1
end if
rs.move(CurrentPage-1)*MaxPerPage
TypeContent=TypeContent&"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
TypeContent=TypeContent&"<tr bgcolor='#009933'><td width='65%'>标题:</td>"
TypeContent=TypeContent&"<td width='25%' align='center'>日期:</td>"
TypeContent=TypeContent&"<td width='10%' align='center'>点击:</td></tr>"
TypeContent=TypeContent&""
for i=1 to rs.pagesize
if rs.eof then
Exit for
end if
TypeContent=TypeContent&"<tr><td><a href=../"&rs("path")&"/"&rs("N_fname")&">"&rs("title")&"</a></td>"
TypeContent=TypeContent&"<td align='center'>"&rs("dateandtime")&"</td>"
TypeContent=TypeContent&"<td align='center'><script language='javascript' src='../hits.asp?newsid="&rs("newsid")&"'></script></td></tr>"
rs.movenext
next
rs.close
set rs=nothing
conn.close
set conn=nothing
TypeContent=TypeContent&"</table>"
PageLoad=PageLoad&"<form name='form1'>"
PageLoad=PageLoad&"&nbsp;页数<font color=red><b>"&currentpage&"</b></font>/"&n&"&nbsp;"
k=currentpage
if k<>1 then
PageLoad=PageLoad&"<In"&"dex.html>首页</a>&nbsp;"
if k=2 then
PageLoad=PageLoad&"<a href=In"&"dex.html>上一页</a>&nbsp;"
else
PageLoad=PageLoad&"<a href="&Type_Fold&"_"&k-1&".htm>上一页</a>&nbsp;"
end if
else
PageLoad=PageLoad&"首页&nbsp;上一页&nbsp;"
end if
if k<>n then
PageLoad=PageLoad&"<a href="&Type_Fold&"_"&k+1&".htm>下一页</a>&nbsp;"
PageLoad=PageLoad&"<a href="&Type_Fold&"_"&n&".htm>尾页</a>&nbsp;"
else
PageLoad=PageLoad&"下一页&nbsp;尾页&nbsp;"
end if
PageLoad=PageLoad&"共有<font color=blue><b>"&totalput&"</b></font>篇文章"
PageLoad=PageLoad&"<select name='menu1' onChange=MM_jumpMenu('parent',this,0)>"
for i=1 to n
if i=1 then
PageLoad=PageLoad&"<option value=In"&"dex.html"
else
PageLoad=PageLoad&"<option value="&Type_Fold&"_"&i&".htm "
end if
if cint(i)=cint(currentpage) then PageLoad=PageLoad& " selected"
PageLoad=PageLoad&">第"&i&"页</option>"
next
PageLoad=PageLoad&"</select></form>"
end if
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set type_d = fso.opentextfile(server.mappath("Admin/more.html"),1,True)
pencat= type_d.ReadAll
pencat=replace(pencat,"$Menu$",Menu)
pencat=replace(pencat,"$TypeContent$",TypeContent)
pencat=replace(pencat,"$PageLoad$",PageLoad)
pencat=replace(pencat,"$TITLE$",Type_Name)
if CurrentPage<2 then
Set type_x = fso.CreateTextFile(server.mappath(Type_Fold&"/In"&"dex.html"),true)
else
Set type_x = fso.CreateTextFile(server.mappath(Type_Fold&"/"&Type_Fold&"_"&currentPage&".htm"),true)
end if
type_x.WriteLine (pencat)
set fso = nothing
type_d.close
type_x.close
response.write "<br>已生成/要生成分类:<font color=#FF0000>"&currentPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
if n=<currentPage then
response.write "操作完成!"
response.Write("<a href='#' onclick=history.back()>返回</a>")
response.end
else
response.write "<br>已生成/此类分页:<font color=#FF0000>"&currentPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
response.write "<meta http-equiv=Refresh content='0; URL=MakeHtml.asp?ItemName="&TypeItem&"&pageNo="&currentPage+1&"'>"
end if
end if
%>
这个绝对没问题我试过了。

中国人的财富网:http://www..cn/
2005-11-23 01:50
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 
你的那个能不能用?

中国人的财富网:http://www..cn/
2005-11-23 01:53
快速回复:我很想了解静态分页的原理
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013002 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved