asp读取大类代码(asp读取大类代码是什么)
admin 发布:2022-12-19 07:24 138
今天给各位分享asp读取大类代码的知识,其中也会对asp读取大类代码是什么进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
- 1、ASP后台中如何调用产品类别代码(大类ID=anclassid 大类名称=anclass;小类ID=nclassid 小类名称=nclass)
- 2、ASP怎么读取二级类在一级类下面?
- 3、asp关于大类小类的问题
ASP后台中如何调用产品类别代码(大类ID=anclassid 大类名称=anclass;小类ID=nclassid 小类名称=nclass)
changelocation 函数有没有呢?如果没有请加上:
%dim counts
set rs=server.createobject("adodb.recordset")
rs.open "select * from ssort ",conn,1,1%
script language = "JavaScript"
var onecount;
onecount=0;
subcat = new Array();
%
counts = 0
do while not rs.eof
%
subcat[%=counts%] = new Array("%= trim(rs("Nclass"))%","%= rs("anclassid")%","%= rs("Nclassid")%");
%
counts = counts + 1
rs.movenext
loop
rs.close
%
onecount=%=counts%;function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
/script
同时去掉小类里的:
onChange="changelocation1(document.myform.Nclassid.options[document.myform.Nclassid.selectedIndex].value)"
ASP怎么读取二级类在一级类下面?
这样要用到参数传递吧,可以如下处理读取一级:
bid=0
select id,name from 你的表名 where bid=0 order by id desc
读取二级::【使用时,网页调用为:xxx.asp?bid=1】
bid=request.querystring("bid")
select id,name from 你的表名 where bid=id order by id desc
asp关于大类小类的问题
根据需要有两种方法
如果要显示成
[大类1] [小类1-1]
[大类1] [小类1-2]
[大类2] [小类2-1]
可以用
select * from 大类表,小类表 where 大类表.id=小类表.分类id and 其它条件 order by 大类表.id asc, 小类表.id asc
这样就直接将大类的记录接到小类的记录上了。如果大类表和小类表有相同名称的字段,要用“大类表.字段”、“小类表.字段”区分(即使已经要求它们相等)。
如果要显示成
[大类1]
[小类1-1]
[小类1-2]
[大类2]
[小类2-1]
可以两层循环嵌套,也可以用上面的方法再加以过滤(记住上次的大类名,发现与新记录的大类名不同就另起一行)。
关于asp读取大类代码和asp读取大类代码是什么的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 05-19seo教程网,seo教程是什么
- 05-19竞价推广代运营,竞价推广代运营是什么意思
- 05-19seo推广是什么意思呢,seo推广是什么工作
- 05-19seo网站,seo网站是什么意思
- 05-19seo优化是什么,SEO优化是什么意思
- 05-18seo网站优化,seo网站优化是做什么的
- 05-18seo是什么职业,seo是做什么的?
- 05-18seo优化是什么意思,seo是什么意思
- 05-18sem优化,sem优化师是做什么的
- 05-18网站建设是干嘛的,网站建设是什么工作
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接