<!--#include file="conn.asp"-->
<script> function openxinx(id) { window.open("xinxi2.asp?news_id="+id,"","width='100%',height='400',left=0,top=0,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes");} </script>
<% newsclass_id=trim(request("newsclass_id")) ''''获取参数 if newsclass_id=empty then newsclass_id="%" end if %> <% sql1="select top 1 * from xinxi where newsclass_id like'"&newsclass_id&"' order by news_id DESC" ''sql1="select * from xinxi where news_pic='' order by news_id DESC" set rs1=server.createobject("adodb.recordset") rs1.open sql1,conn,1,1 news_title=rs1("news_title") news_id=rs1("news_id") ''news_pic=rs1("news_pic") if rs1.eof then else do while not rs1.eof%>
<%if len(rs1("news_title"))>10 then news_title=left(rs1("news_title"),10) %><br>·<a href='javascript:openxinx(<%=rs1("news_id")%>)'><%response.write "" & news_title & ""%>...</a> <%else%> <br>·<a href='javascript:openxinx(<%=rs1("news_id")%>)'><%=rs1("news_title")%>...</a> <%end if%>
<%rs1.movenext loop end if rs1.close %> <script language=Javascript>
function jumpTo(i){ if(i==1){ this.document.location="<%=thisUrl%>";} if(i==2){ this.document.location="<%=thisUrl%>&page=<%=page-1%>";} if(i==3){ this.document.location="<%=thisUrl%>&page=<%=page+1%>";} if(i==4){ this.document.location="<%=thisUrl%>&page=<%=rs1.pageCount%>";} }
</script> <% dim page,maxPerPage maxPerPage=1 '每页显示的记录数 page=Request("page") if (page="" or isempty(page)) then page=1 thisUrl="fenleixx.asp?true=1" set rs1=server.createobject("adodb.recordset") sql="select * from xinxi order by news_id desc" rs1.open sql,conn,1,1 rs1.pagesize=MaxPerPage %>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="89%"> <div align="right"><%=rs1.recordCount%> 项 第<%=page%>/<%=rs1.pageCount%> 页 <%if page>1 then%> <input type="button" name="Submit3" value="首页" onClick="Javascript:jumpTo(1)"> <input type="submit" name="Submit42" value="上页" onClick="Javascript:jumpTo(2)"> <%else%> <input type="button" name="Submit32" value="首页" disabled> <input type="submit" name="Submit4" value="上页" disabled> <%end if if rs1.recordCount>page*maxPerPage then%> <input type="submit" name="Submit5" value="下页" onClick="Javascript:jumpTo(3)"> <input type="submit" name="Submit6" value="末页" onClick="Javascript:jumpTo(4)"> <%else%> <input type="submit" name="Submit5" value="下页" disabled> <input type="submit" name="Submit6" value="末页" disabled> <%end if rs1.close%> </div></td> </tr> </table>
这是一个显示信息和分页的编码。第一部分是显示信息,第二部分是分页处理,以FUNCTION JUMPTO 函数为界。
问题是,分页处理的哪个JUMPTO函数可能是有问题,也可能是位置的问题,当把他放在下边的TABLE之前,表格就不被显示了,放TABLE之后时,虽然显示但翻页不能进行,在状态拦显示网页有错误。
哪分页的代码,我从别处封装起来了,单独用的时候应该是没问题。不知道和这个页面一起就出问题了,请指教。。。