<div class="weekly_content_list">
    <%'开始分页
    Const MaxPerPage=2
       dim totalPut  
       dim CurrentPage
       dim TotalPages
       dim j
      
        if Not isempty(request("page")) then
          currentPage=Cint(request("page"))
       else
          currentPage=1
       end if
Set Rs = Db.CreateRS()
sql="select * from weekly"
sql="select * from weeklySort where ID>0"
namekey=FLib.SafeSql(Request("namekey"))
if namekey<>"" then
sql=sql&" and SortName like '%"&namekey&"%'"  
end if
if SortID<>"" then
sql=sql&" and SortID="&SortID&""
end if
sql=sql&" order by PX desc"
Rs.Open Sql, Db.Conn, 1, 1
   
    if err.number<>0 then
    response.write "数据库中无数据"
    end if
   
      if rs.eof And rs.bof then
           Response.Write "<p align='center' class='contents'> 没有此类信息!<a href='#' onclick='history.go(-1);'>返回上一步</a></p>"
       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,"weekly.asp"
           else
              if (currentPage-1)*MaxPerPage<totalPut then
                rs.move  (currentPage-1)*MaxPerPage
                dim book
                book=rs.book
                showContent
                 showpage totalput,MaxPerPage,"weekly.asp"
            else
             currentPage=1
                showContent
                showpage totalput,MaxPerPage,"weekly.asp"
           end if
        end if
              end if       sub showContent
          dim i
       i=0
   %>
                <div>
                  <%
        cols=3
do while not rs.eof
if abc mod cols=0 then response.Write("<tr>")
abc=abc+1
%>
           
               <div class="weekly_content_list_table">
                  <div class="weekly_content_list_time">
                    <img src="../<%=rs("SmallPic")%>"  />
                  </div>
                  <div class="weekly_content_list_name" style="background-color:#999; text-align:center; font-size:17px;"><%=rs("SortName")%></div>
                  <div class="weekly_content_list_name">
                   <li><a href="#">小标题2</a></li>
                   <li><a href="#">小标题2</a></li>
                   <li><a href="#">小标题2</a></li>
                   <li><a href="#">小标题2</a></li>
                  </div>
               </div><%
  i=i+1
         if i>=MaxPerPage then Exit Do
          rs.movenext
          loop
          rs.close
         set rs=nothing%>
                </div>
            </div> 

解决方案 »

  1.   

    <div class="weekly_content_list_name">需要把这个里面的li列表换成从数据库里索引数据,用了很多方法都不行
      

  2.   

    用.net的思维去修改asp页面,我估计全部要换吧
      

  3.   

    看见dim就好像看到vb了,是不是有vb在里面啊、、、
      

  4.   

    想在li列表显示weekly表里面的sortid等于weeklysort里的id  的内容
      

  5.   


    想在li列表显示weekly表里面的sortid等于weeklysort里的id 的内容:<div class="weekly_content_list_name">
       <li><a href="#">小标题2</a></li>
       <li><a href="#">小标题2</a></li>
       <li><a href="#">小标题2</a></li>
       <li><a href="#">小标题2</a></li>
    </div>这里再做个查询和循环显示就行了啊貌似很容易
     
      

  6.   

    这全部是 VBScript的写的啊  都忘了差不多了 去WEB大版的 asp 专区提问吧
      

  7.   

    <%
     Set Rs = Db.CreateRS()
     Sql = "Select top 11 ID,ProductName,SortID,AddTime from weekly where SortID=SortID"
             Rs.Open Sql, Db.Conn, 1, 1
     if Not Rs.eof then
     do while not rs.eof%>
                        <li><a href="viewweek.asp?weeklyID=<%=Rs("ID")%>&amp;SortID=<%=rs("SortID")%>" target="_blank"><span><%=left(Rs("ProductName"),8)%></span></a></li>
    <%
      rs.movenext
      loop
      end if
      rs.close
      set rs=nothing
      %>
    直接替换过去就是了
      

  8.   

    asp的代码,vb脚本。问错版块了。。li里面的东西,应该是<%=rs("列名")%>这样的东西吧。
      

  9.   

    前面用到了RS,这里又用一次?? 换一个变量名。  
    你是想做一个二级查询,SQL 中的条件要用到第一个RS中的SortID
    SortID=rs["SortID"]
      

  10.   

    郁闷,行不通
    <%
     Set Rs = Db.CreateRS()
     Sql = "Select top 11 ProductName,SortID,AddTime from weekly where SortID=<%=rs("SortID")%>"
             Rs.Open Sql, Db.Conn, 1, 1
     if Not Rs.eof then
     do while not rs.eof%>
                        <li><a href="viewweek.asp?weeklyID=<%=Rs("ID")%>&amp;SortID=<%=rs("SortID")%>" target="_blank"><span><%=left(Rs("ProductName"),8)%></span></a></li>
    <%
      rs.movenext
      loop
      end if
      rs.close
      set rs=nothing
      %>
      

  11.   

    Sql = "Select top 11 ProductName,SortID,AddTime from weekly where SortID=" & rs("SortID")另外第二个rs改成rsSub,不能重复利用同一个变量! 
      

  12.   

    求指点,SortID应该怎么样赋值
      

  13.   

    Sql = "Select top 11 ID,ProductName,SortID,AddTime from weekly where SortID='SortID'"
      

  14.   

    败给你了。Sql = "Select top 11 ID,ProductName,SortID,AddTime from weekly where SortID='" & rs("SortID") & "'"
      

  15.   

    <%
    Set Rs = Db.CreateRS()
     Sql = "Select top 11 ProductName,SortID,AddTime from weekly where SortID=<%=rs("SortID")%>"
       Rs.Open Sql, Db.Conn, 1, 1
     if Not Rs.eof then这个SQL明显有问题,楼上都告诉你怎么改了,咋还没找到呢? Sql = "Select top 11 ProductName,SortID,AddTime from weekly where SortID=" & rs("SortID")