首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

各位大侠,帮帮忙,二级菜单生成双列,该如何处理

2012-05-28 
各位大侠,帮帮忙,二级菜单生成双列Function Folder(id)Dim rs, sql, i, ChildCount, FolderType, FolderNa

各位大侠,帮帮忙,二级菜单生成双列
Function Folder(id)
  Dim rs, sql, i, ChildCount, FolderType, FolderName, onMouseUp, ListType
  Set rs = server.CreateObject("adodb.recordset")
  sql = "Select * From Qianbo_ProductSort where ParentID="&id&" order by id"
  rs.Open sql, conn, 1, 1
  If id = 0 And rs.recordcount = 0 Then
  response.Write ("<center>暂无产品分类</center>")
  Exit Function
  End If
  i = 1
  response.Write("<table border=""0"" cellspacing=""0"" cellpadding=""0"">")
  While Not rs.EOF
  ChildCount = conn.Execute("select count(*) from Qianbo_ProductSort where ParentID="&rs("id"))(0)
  If ChildCount = 0 Then
  If i = rs.recordcount Then
  FolderType = "SortFileEnd"
  Else
  FolderType = "SortFile"
  End If
  FolderName = rs("SortName")
  onMouseUp = ""
  Else
  If i = rs.recordcount Then
  FolderType = "SortEndFolderClose"
  ListType = "SortEndListline"
  onMouseUp = "EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
  Else
  FolderType = "SortFolderClose"
  ListType = "SortListline"
  onMouseUp = "SortChange('a"&rs("id")&"','b"&rs("id")&"');"
  End If
  FolderName = rs("SortName")
  End If
  datafrom = "Qianbo_ProductSort"
  If ISHTML = 1 Then
  AutoLink = ""&ProSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
  Else
  AutoLink = "ProductList.Asp?SortID="&rs("ID")&""
  End If
  response.Write "<tr height=""23"" >"
  response.Write("<td nowrap id=""b"&rs("id")&""" class="""&FolderType&"""></td><td nowrap style=""padding-top: 2px""><a href="""&AutoLink&""">"&FolderName&"</a></td></tr>")
  If ChildCount>0 Then
%>
<tr id="a<%= rs("id")%>" style="display:yes">
  <td class="<%= ListType%>" nowrap></td>
  <td><% Folder(rs("id")) %></td>
</tr>
<%
End If
rs.movenext
i = i + 1
Wend
response.Write("</table>")
rs.Close
Set rs = Nothing
End Function


最后生成的代码:
<table cellspacing="0" cellpadding="0" border="0"><tbody>
  <tr height="23">
  <td nowrap="" class="SortFolderClose" id="b1"></td>
  <td nowrap="" style="padding-top: 2px"><a href="ProductClass_1_1.html">产品世界</a></td> //一级菜单
  </tr>
  <tr style="display:yes" id="a1">
  <td nowrap="" class="SortListline"></td>


  <td><table cellspacing="0" cellpadding="0" border="0"><tbody>
  <tr height="23">
  <td nowrap="" class="SortFile" id="b2"></td>
  <td nowrap="" style="padding-top: 2px"><a href="ProductClass_2_1.html">产品总汇</a></td>
  </tr>
  <tr height="23">
  <td nowrap="" class="SortFile" id="b4"></td>
  <td nowrap="" style="padding-top: 2px"><a href="ProductClass_4_1.html">图片汇总</a></td>
  </tr>
  </tbody></table></td>  
  </tr>
  <tr height="23">
  <td nowrap="" class="SortEndFolderClose" id="b6"></td>
  <td nowrap="" style="padding-top: 2px"><a href="ProductClass_6_1.html">产品世界2</a></td> //一级菜单
  </tr>
  <tr style="display:yes" id="a6">
  <td nowrap="" class="SortEndListline"></td>
  <td><table cellspacing="0" cellpadding="0" border="0"><tbody>  
  <tr height="23">
  <td nowrap="" class="SortFile" id="b8"></td>
  <td nowrap="" style="padding-top: 2px"><a href="ProductClass_8_1.html">产品世界24</a></td>
  </tr>
  <tr height="23">
  <td nowrap="" class="SortFile" id="b9"></td>
  <td nowrap="" style="padding-top: 2px"><a href="ProductClass_9_1.html">产品世界25</a></td>
  </tr>
</tbody></table>



请问怎样生成双列的?谢谢

[解决办法]
现在html整好是什么样子把,再去看程序读出数据怎么填充..

热点排行