现在是菜单的二级部分,这里不是用跳转菜单,只是一个列表罢了,所以代码跟上面的跳转菜单也就差一个onchange这个函数。 以下是这个菜单的代码,由于循环跟判断相对上面来说复杂一些,大伙要看清楚一点哦。 <select name="second"> <%if rs.eof or rs.bof then response.write ("<option>--------</option>") else if request.querystring("sec") = "" then '获取跳转之后的sec值 temp=rs(0) 如果为空,就把temp的值设为第一条记录的值 else temp = request.querystring("sec") '否则就为收到的值 end if subsql = "select [s_name] from [s_type] where type_id='"&temp&"'" set subrs = conn.execute(subsql) '列出一切资料为temp的记录 if subrs.eof or subrs.bof then response.write ("<option>-----</option>") '如果没有记录,则在这个列表中显示"-----" else while not(subrs.eof or subrs.bof)'否则就用循环列出一切符合条件的记录。 response.write ("<option value=" & subrs(0) & ">" & subrs(0) & "</option>") subrs.movenext wend end if end if
'关闭所有的记录集 subrs.close set subrs = nothing rs.close set rs = nothing conn.close set conn = nothing %> </select>
到现在为止,已经将这个二级菜单的制过程做完了,很简单的一个看把我给说的。 大家看不懂再说吧,反正我已经不知道该怎么说了。 高手们不吝赐教啊。。。
出处:蓝色理想
责任编辑:帅青蛙
上一页 DW+ASP 玩转动态二级菜单 [1] 下一页
◎进入论坛网络编程版块参加讨论
|