<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!-- #include file="conn.asp" --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title></title> <mce:style type="text/css"><!-- .STYLE1 {color: #FFFFFF} td{font-size:12px;padding-left:5px;} --></mce:style><style type="text/css" mce_bogus="1">.STYLE1 {color: #FFFFFF} td{font-size:12px;padding-left:5px;}</style> </head> <body> <table width="300" border="1" cellspacing="0" cellpadding="0"> <tr> <td width="74" height="22" bgcolor="#0000FF"><span class="STYLE1">ID</span></td> <td width="226" bgcolor="#0000FF"><span class="STYLE1">标题</span></td> </tr> <% sql="select id,title from news order by id desc" rs.open sql,conn,1,1 If rs.eof Then Else rs.pagesize=3 page=request("page") If Not Isnumeric(page) or page="" Then page=1 else page=cint(page) End if if page<1 then page=1 if page>rs.pagecount then page=rs.pagecount rs.AbsolutePage = page for i=1 to rs.pagesize id = rs("id") title = rs("title") '******************下面是你要显示的******************' %> <tr> <td height="22"><%=id%></td> <td><a href="news.asp?id=<%=id%>" target="_blank"><%=title%></a></td> </tr> <% '******************上面是你要显示的******************' rs.movenext if rs.eof then Exit For End if next end if %> <tr> <td height="22" colspan="2"><% if page>2 then s1=page-2 else s1=1 if page<rs.pagecount-2 then s2=page+2 else s2=rs.pagecount if s1>=2 then response.write ".." for j=s1 to s2 if j=page then response.write "<a href=""?page="&j&"""><font color=#ff0000>"&j&"</font></a> " else response.write "<a href=""?page="&j&""">"&j&"</a> " end if next if s2<rs.pagecount then response.write ".." rs.close %></td> </tr> </table> </body> </html> <% set rs=nothing%>