请教各位大侠生成静态分页的问题
刚做的一个生成静态分页的,生是生成功了但是生成的每页的内容都是相同的(上一页的内容和下一页的内容相同)而且这个分页(动态)好像还不好使麻烦各位大侠帮年一下
这是后台的生成页面
Private Sub Createpage()
server.ScriptTimeout=300
Set Rs=Server.CreateObject("Adodb.recordset")
Sql="select * From [PubPress]"
Rs.open Sql,conn,1,1
Rs.PageSize=10
If Rs.eof then
response.Write("无文章需要生成")
Else
page=1
Do While Not Rs.eof and page<=Rs.PageCount
for i=1 to Rs.PageCount
response.Write "../Catalog_"&page&".html"
path=server.MapPath("../"&Catalog&"_"&page&".html")
'response.Write path
'response.end
port=request.ServerVariables("SERVER_Port")
StrURL="http://"&request.ServerVariables("SERVER_NAME")&":"&port&"/文学教育/HTML/Catalog.asp"
StrURL="http://"&request.ServerVariables("SERVER_NAME")&":"&port&"/HTML/Catalog.asp?id="&rs("id")&""
Response.write(StrURL&"<br>")
Set ObjXmlHttp=Server.CreateObject("Microsoft.XMLHTTP")
ObjXmlHttp.open "GET",StrURL,false
ObjXmlHttp.send()
binFileData=ObjXmlHttp.responseBody
Set ObjAdoStream=Server.CreateObject("Adodb.Stream")
ObjAdoStream.Type=1
ObjAdoStream.open()
ObjAdoStream.write(binFileData)
ObjAdoStream.SaveToFile path,2
Rs.movenext
page=page+1
Next
Loop
ObjAdoStream.Close()
Response.Write("列表页面生成完毕!<br>")
End if
End Sub
Private Sub CreateLine()
Response.write("<hr style='width='80%;color:red;''/>")
End Sub
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////server.ScriptTimeout=300
Set Rs=Server.CreateObject("Adodb.recordset")
Sql="select * From [PubPress]"
Rs.open Sql,conn,1,1
Rs.PageSize=10
If Rs.eof then
response.Write("无文章需要生成")
Else
page=1
Do While Not Rs.eof and page<=Rs.PageCount
for i=1 to Rs.PageCount
response.Write "../Catalog_"&page&".html"
path=server.MapPath("../"&Catalog&"_"&page&".html")
'response.Write path
'response.end
port=request.ServerVariables("SERVER_Port")
StrURL="http://"&request.ServerVariables("SERVER_NAME")&":"&port&"/文学教育/HTML/Catalog.asp"
StrURL="http://"&request.ServerVariables("SERVER_NAME")&":"&port&"/HTML/Catalog.asp?id="&rs("id")&""
Response.write(StrURL&"<br>")
Set ObjXmlHttp=Server.CreateObject("Microsoft.XMLHTTP")
ObjXmlHttp.open "GET",StrURL,false
ObjXmlHttp.send()
binFileData=ObjXmlHttp.responseBody
Set ObjAdoStream=Server.CreateObject("Adodb.Stream")
ObjAdoStream.Type=1
ObjAdoStream.open()
ObjAdoStream.write(binFileData)
ObjAdoStream.SaveToFile path,2
Rs.movenext
page=page+1
Next
Loop
ObjAdoStream.Close()
Response.Write("列表页面生成完毕!<br>")
End if
End Sub
Private Sub CreateLine()
Response.write("<hr style='width='80%;color:red;''/>")
End Sub
这是前台的动态页面,我把ASP换成了HTML
<%
SmallClass=Request.QueryString("SmallClass")
If SmallClass="" then
SmallClass="Catalog"
'end if
Page = Request.QueryString("page")
If IsNull(Page) Then
Page = 1
Elseif IsNumeric(Page) = False Then
Page = 1
Elseif Page < 1 OR Page > 200 Then
Page = 1
Else
Page = Cint(Page)
End if
Set Rs=Server.CreateObject("Adodb.Recordset")
Sql="select * from [PubPress] order by id desc"
Rs.open Sql,conn,1,1
If Rs.RecordCount > 0 Then
Rs.PageSize =1
If Page > Rs.PageCount Then Rs.AbsolutePage = Rs.PageCount Else Rs.AbsolutePage = Page
Rs.AbsolutePage = Page
For j=1 to Rs.PageSize
If Rs.eof then Exit for
call ShowCatalog(5,20,1,1,1)
Next
End if
%>
</ul>
<div align="center">共<%=Rs.RecordCount%>条新闻,第<%=page%>/<%=Rs.PageCount%>页
<%if page=1 then%>
首页
<%else%>
<a href="Catalog_1.html">首页</a>
<%end if%>
<%if page=1 then%>
上一页
<%else%>
<a href="Catalog_<%=page-1%>.html">上一页</a>
<%end if%>
<%if rs.pagecount<page+1 then%>
下一页
<%else%>
<a href="Catalog_<%=page+1%>.html">下一页</a>
<%end if%>
<%if rs.pagecount<page+1 then%>
尾页
<%else%>
<a href="Catalog_<%=rs.pagecount%>.html">尾页</a>
<%end if%>
<%end if%>
SmallClass=Request.QueryString("SmallClass")
If SmallClass="" then
SmallClass="Catalog"
'end if
Page = Request.QueryString("page")
If IsNull(Page) Then
Page = 1
Elseif IsNumeric(Page) = False Then
Page = 1
Elseif Page < 1 OR Page > 200 Then
Page = 1
Else
Page = Cint(Page)
End if
Set Rs=Server.CreateObject("Adodb.Recordset")
Sql="select * from [PubPress] order by id desc"
Rs.open Sql,conn,1,1
If Rs.RecordCount > 0 Then
Rs.PageSize =1
If Page > Rs.PageCount Then Rs.AbsolutePage = Rs.PageCount Else Rs.AbsolutePage = Page
Rs.AbsolutePage = Page
For j=1 to Rs.PageSize
If Rs.eof then Exit for
call ShowCatalog(5,20,1,1,1)
Next
End if
%>
</ul>
<div align="center">共<%=Rs.RecordCount%>条新闻,第<%=page%>/<%=Rs.PageCount%>页
<%if page=1 then%>
首页
<%else%>
<a href="Catalog_1.html">首页</a>
<%end if%>
<%if page=1 then%>
上一页
<%else%>
<a href="Catalog_<%=page-1%>.html">上一页</a>
<%end if%>
<%if rs.pagecount<page+1 then%>
下一页
<%else%>
<a href="Catalog_<%=page+1%>.html">下一页</a>
<%end if%>
<%if rs.pagecount<page+1 then%>
尾页
<%else%>
<a href="Catalog_<%=rs.pagecount%>.html">尾页</a>
<%end if%>
<%end if%>