const MaxPerPage=10
分頁顯示新聞的數量
dim總輸入,當前頁面,總頁面,類型,sql
typ =請求。QueryString("type ")
if typ & lt& gt”“那麽
如果不是isempty(request . query string(" num ")),則
current page = cint(request . query string(" num "))
其他
currentPage=1
如果…就會結束
% & gt
& lt%
SQL = " select * from news where news _ type = " & amp;典型& amp“按desc新聞時間排序”
康涅狄格州,1,1
totalPut=rs.recordcount
如果rs.eof那麽
response.write " & ltp align='center ' >沒有相關消息
其他
if currentpage & lt那麽1
currentpage=1
如果…就會結束
if(current page-1)* MaxPerPage & lt;那麽總投入
RS . move(current page-1)* MaxPerPage
顯示內容
展示頁面
如果…就會結束
如果…就會結束
如果(current page-1)* MaxPerPage = total put,則
RS . move(current page-1)* MaxPerPage
顯示內容
展示頁面
如果…就會結束
% & gt
& lt%
子顯示內容()
i=0
response.write " & ltdiv align = center & gt& lt表格寬度= 100% border = 0 cellspacing = 0 cell padding = 0 & gt;”
做而不做
response.write " & lttr class=9p>。& ltTD width = 9% height = 25 align = center valign = middle class = 9 red & gt。★& lt;/TD >;
模糊url
如果rs("news_jg")="1 "那麽
url="news_detail1.asp?id = " & amprs("id ")
其他
url="news_detail2.asp?id = " & amprs("id ")
如果…就會結束
response.write " & ltTD width = 91% height = 25 align = left valign = middle class = hand onClick = MM _ openbr window(" & amp;網址& ampNews ',' scrollbars = yes,resizable = yes,width = 556,height = 360 ')> "
if len(RS(" news _ title ")& gt;那就20吧
response . write left(RS(" news _ title "),18)& amp;".."& amp" & lt"& amp年份(rs(“新聞時間”)& amp“/”& amp;月(rs("新聞時間"))& amp" >
其他
response . write RS(" news _ title ")& amp;" & lt"& amp年份(rs(“新聞時間”)& amp“/”& amp;月(rs("新聞時間"))& amp" >
如果…就會結束
response.write " & lt/TD & gt;& lt/tr >;
i=i+1
如果我& gt=MaxPerPage那麽
出口do
其他
rs.movenext
如果…就會結束
環
response.write " & lt/TD & gt;& lt/tr & gt;& lt/table & gt;& lt/div >;"
end sub % >;
& lt%
子顯示頁面()
暗淡的
如果(totalPut mod MaxPerPage)=0,則
n=總吞吐量\最大頁面
其他
n=總輸入\最大頁面+ 1
如果…就會結束
如果n=0,則
response.write " & ltp align='right'>。此類別中沒有新聞
出口接頭
如果…就會結束
暗淡k
response.write " & ltdiv align = center & gt& ltbr & gt分頁> >
if currentPage & lt& gt那麽
對於k=1到n
如果k =當前頁面,則
response.write"["+Cstr(k)+"]"
其他
response.write " & lta href=show_newsmore.asp?num = " & ampcstr(k)和amp“& amptype = ' " & amptrim(RS(" news _ type ")& amp;& gt[" & amp;CSTR(k)& amp;]& lt;/a & gt;"
如果…就會結束
然後
response.write " & lt/div >;"
其他
Response.write“最後壹頁”&;“& lta href = ' # ' onclick = JavaScript:history . go(-1)& gt;返回
如果…就會結束
末端接頭
% & gt
& lt%
rs關閉
設置rs =無
連接關閉
set conn = nothing % & gt