急,帮帮我,asp问题?

来源:百度知道 编辑:UC知道 时间:2024/05/25 21:49:57
1.请问一下<option value="b2b_editproduct.asp?cid=<%=int(rs1("categoryid"))%>" <% if int(rs1("categoryid"))="&CID&" Then Response.write("Selected") %>> <%=rs1("category")%> </option>这句中除了value这个参数,在后面怎么多了句<% if int(rs1("categoryid"))="&CID&" Then Response.write("Selected") %>,干什么用的?
2.这里为什么要分selec=0和else两种情况来输出<option>呢,就是有标号的9至20句,说说你的理解行吗?

完整的代码如下:
sort(0)
dim ii
ii=0
sub sort(selec)
sql="select * from category where ParentID = "&selec&" order by categoryorder"
Set Rs1=Conn.Execute(sql)
do while not rs1.eof
9.if selec=0 then
10.%>
11.<option value="b2b_editproduct.asp?cid=<%=int(rs1("categoryid"))%12.>" <% if int(rs1("categoryid"))="&CID&" Then Response.write 13.("Selected") %>> <%

1\ 如果生成的下拉框中的选项值为 CID 则 选定他.
2\selec 是一个传过来的参数,用他来决定生成不同的下拉框,请注意看两个下拉框的内容是不一样的.
cid=<%=int(rs1("categoryid"))%12.>" '=0
cid=<%=int(rs1 18.("categoryid"))%>" '!0