我点击一类后转入页面,所在的页面保持点击那时候的,,再点第二个类后显示第二个类的子类,,转入页面后保持显示是第二个类的子类,
参考这个站左边的产品分类,,
点手机看到手机的类,,再点电池看到电池的类,参考http://www.xunjieshop.com/Product/ProductList.aspx?CategoryID=2

解决方案 »

  1.   

    就是根据传递的 categoryid来判断然后显示需要的就好了
      

  2.   

    根据后面那个参数来显示咯CategoryID=2
    Dim strSql, Rs1, Rs2, categoryID
    categoryID = Trim(Request.QueryString("CategoryID"))
    strSql = "Select * From [Category] Where parentID = 0"
    Set Rs1 = Conn.Execute(strSql)
    Do While Not Rs1.Eof
      Response.Write(Rs1("CategoryName") & "<br/>")  '检测是否为当前显示类
      If Rs1("CategoryID") = categoryID Then    '显示当前类的子类
         strSql = "Select * From [Category] Where parentID =" & categoryID
        Set Rs2 = Conn.Execute(strSql)
        Do While Not Rs2.Eof      '显示子类
           Response.Write("&nbsp;&nbsp;" & Rs2("Categoryname") & "<br/>")
          Rs2.MoveNext()
        Loop
        Rs2.Close()
        Set Rs2 = Nothing
      End If
      Rs1.MoveNext()
    Loop
    Rs1.Close()
    Set Rs1 = Nothing用Asp模拟了一下
      

  3.   

    楼主,我看了你的代码。问题出在这里:<img id="imgphone" src="../image/Icon17.gif" width="9" height="9"/> 手 机</a>          
              <div id="lnkphonefloatdiv" style="display:block;" >
    <img id="imgBattery" src="../image/Icon18.gif" width="9" height="9"/> 电 池</a> 
               <div id="lnkBatteryfloatdiv" style="display:none;" >
    --
    请根据ProductList.aspx?CategoryID=2的参数值来判断并设置display的值,这样就可以达到目的了。