<% dim Titletop,c c=3 Titletop = "案例展示" '########### 网页名称 %><%=Titletop%>:<%=webname%>-<%=VPcopyright%>
首页 » 案例展示
<% if row_count mod 4 =0 then response.write "" end if i=i+1 if i>=MaxPerPage then Exit Do rs.movenext row_count=row_count+1 loop rs.close set rs=nothing %>
案例
<% set rs = server.CreateObject("adodb.recordset") rs.open "select id,name from product order by viewnum desc",conn,1,1 if rs.eof and rs.bof then response.Write "该栏目还没有添加新闻!" else do while not rs.eof %> <% rs.movenext loop rs.close set rs = nothing end if %>
" /><% if len(rs("name"))<=12 then response.Write rs("name") else response.Write left(rs("name"),11)&"..." end if %>
<%=Titletop%>  
<% Const MaxPerPage=12 dim totalPut dim CurrentPage dim TotalPages dim j dim sql if Not isempty(SafeRequest("page",1)) then currentPage=Cint(SafeRequest("page",1)) else currentPage=1 end if set rs = server.CreateObject("adodb.recordset") if nameSearch="" then if SafeRequest("cid",1)="" then rs.open "select id,name,adddate,pic,detail,content,contentt from product order by viewnum desc",conn,1,1 else rs.open "select id,name,adddate,pic,detail,content,contentt from product where sortsid="&cid&" order by viewnum desc",conn,1,1 end if else if search_name=0 then rs.open "select id,name,adddate,pic,detail,content,contentt from product where name like '%"&nameSearch&"%' order by viewnum desc",conn,1,1 else rs.open "select id,name,adddate,pic,detail,content,contentt from product where name like '%"&nameSearch&"%' order by viewnum desc",conn,1,1 end if end if if rs.eof And rs.bof then Response.Write "

对不起,此分类暂时还没有内容!

" else totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"Product.asp" else if (currentPage-1)*MaxPerPage
<% End Sub Function showpage(totalnumber,maxperpage,filename) Dim n If totalnumber Mod maxperpage=0 Then n= totalnumber \ maxperpage Else n= totalnumber \ maxperpage+1 End If if cid<>"" then %>
?&id=<% = id %>&cid=<% = cid %>> <% If CurrentPage<2 Then %> 首页 上页 <% Else %> ?page=1&id=<% = id %>&cid=<% = cid %>>首页 ?page=<% = CurrentPage-1 %>&id=<% = id %>&cid=<% = cid %>>上页 <% End If If n-currentpage<1 Then %> 下页 末页 <% Else %> ?page=<% = (CurrentPage+1) %>&id=<% = id %>&cid=<% = cid %>>下页 ?page=<% = n %>&id=<% = id %>&cid=<% = cid %>>末页 <% End If Else %> ?&id=<% = id %>> <% If CurrentPage<2 Then %> 首页 上页 <% Else %> ?page=1&id=<% = id %>>首页 ?page=<% = CurrentPage-1 %>&id=<% = id %>>上页 <% End If If n-currentpage<1 Then %> 下页 末页 <% Else %> ?page=<% = (CurrentPage+1) %>&id=<% = id %>>下页 ?page=<% = n %>&id=<% = id %>>末页 <% End If %> <% End If %> 第 <% = CurrentPage %> 页 共 <% = n %> 页 共  <% = totalnumber %>  个资讯 每页 <% = maxperpage %> 个资讯 转到第: > 页
<% End Function %>