asp关联二级菜单问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 08:42:18
该代码只能看大类的列表,小类的看不到,请各位大侠指点一下,运行成功后我会追加100分!

<!--#include file="conn.asp" -->
<html>
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from shop_nclass order by nclassidorder"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("nclass"))%>","<%= trim(rs("anclassid"))%>","<%= trim(rs("nclassid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;

function changelocation(locationid)
{
document.form1.sid.length = 0

代码是没有问题的,你应该检查一下你的小类是否与大类的连接做好了,就是一个大类下面的小类的序号是否对应,应该是你的数据库表之间的连接做错了!

<!--#include file="conn.asp" -->
<html>
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from shop_nclass order by nclassidorder"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("nclass"))%>","<%= trim(rs("anclassid"))%>","<%= trim(rs("nclassid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;

function changelocation(locationid)
{
document.form1.sid.length = 0;

var locationid=locationid