list.asp
<%Option Explicit%>
'新闻主类别列表 sql=\set rs=server.CreateObject(\rs.open sql,conn,3,1 if rs.eof then response.write\暂无分类\else do while not rs.eof response.write href=list.asp?bClassID=\ rs.movenext loop \ end if %> | |
| '新闻列表 dim PgSz,total,page,RowCount,qu,record,classID,bClassID classID=request.QueryString(\bClassID=request.QueryString(\if bClassID=\bClassID=1 end if set rs=Server.CreateObject(\ if classID=\ sql=\ORDER BY newsID DESC\else sql=\and classID='\end if rs.open sql,Conn,1,1 if rs.RecordCount=0 then response.write\暂无新闻 \elserecord=rs.recordcount PgSz=15 '每页显示的新闻数量 rs.PageSize = Cint(PgSz) total=int(record/PgSz*-1)*-1 page=Request(\if page=\page = 1 else page=page+1 page=page-1 end if if page<1 Then page=1 end if rs.absolutePage = page dim start start=PgSz*Page-PgSz+1 sub showpage() if page > 1 Then response.write href=list.asp?bClassID=\class=1>上一页 \else response.write \上一页 \end if if RowCount = 0 and page <>Total then response.write \ \ |