• 模拟动网当前位置下拉菜单


    模拟动网当前位置下拉菜单
    如图:


    代码如下:

    public string GetBoardDropDownList(int paraParentID)
      {
       string BoardText = "<script language=\"javascript\" type=\"text/javascript\">";
       BoardText += "var boardxml='<?xml version=\"1.0\" encoding=\"gb2312\"?>";
       BoardText += "<BoardList>";
       BoardText +=BoardRec(0);
       BoardText += "</BoardList>';</script>";
       return BoardText;
      }
      public string BoardRec(int paraParentID)
      {
       string BoardText= "";
       DataSet ds1 = myCData.GetDataSet("select * from DV_Board where ParentID="+paraParentID+" order by orders Asc",0,0,"TableName");
       for(int j = 0;j<ds1.Tables[0].Rows.Count;j++)
       {
        int BoardID = Convert.ToInt32(ds1.Tables[0].Rows[j]["BoardID"]);
        string BoardType = ds1.Tables[0].Rows[j]["BoardType"].ToString();
        int Parentid = Convert.ToInt32(ds1.Tables[0].Rows[j]["parentid"]);
        int Depth = Convert.ToInt32(ds1.Tables[0].Rows[j]["depth"]);
        int Rootid = Convert.ToInt32(ds1.Tables[0].Rows[j]["rootid"]);
        int Child = Convert.ToInt32(ds1.Tables[0].Rows[j]["child"]);
        int Hidden = 0;
        int Nopost = 0;
        if(Child==0)
        {
         Nopost = 0;
         BoardText += "<board boardid=\""+BoardID+"\" boardtype=\""+BoardType+"\" parentid=\""+Parentid+"\" depth=\""+Depth+"\" rootid=\""+Rootid+"\" child=\""+Child+"\" hidden=\""+Hidden+"\" nopost=\""+Nopost+"\"></board>";
        }
        else
        {
         Nopost = 1;
         BoardText += "<board boardid=\""+BoardID+"\" boardtype=\""+BoardType+"\" parentid=\""+Parentid+"\" depth=\""+Depth+"\" rootid=\""+Rootid+"\" child=\""+Child+"\" hidden=\""+Hidden+"\" nopost=\""+Nopost+"\">";
         BoardText +=BoardRec(BoardID);
         BoardText +="</board>";
        }
       }
       ds1.Clear();
       return BoardText;
      }
      public string GetBoardPostioin(string paraBBSName,int paraBoardID)
      {
       string BoardText= "";
       BoardText = "<a href='index.aspx' onMouseOver=\"showmenu(event,BoardJumpList(0),'',0);\">"+paraBBSName+"</a>";
       BoardText += GetBoardPostioinRec(paraBoardID);
       return BoardText;
      }
      public string GetBoardPostioinRec(int paraParentID)
      {
       string BoardText= "";
       if(paraParentID!=0)
       {
        DataSet ds1 = myCData.GetDataSet("select * from DV_Board where BoardID="+paraParentID+" order by orders Asc",0,0,"TableName");
        if(ds1.Tables[0].Rows.Count>0)
        {
         if(Convert.ToInt32(ds1.Tables[0].Rows[0]["Child"])>0)
         {
          BoardText = " → <a href='index.aspx?BoardID="+ds1.Tables[0].Rows[0]["BoardID"].ToString()+"' onMouseOver=\"showmenu(event,BoardJumpList("+ds1.Tables[0].Rows[0]["BoardID"].ToString()+"),'',0);\">"+ds1.Tables[0].Rows[0]["BoardType"].ToString()+"</a>";
         }
         else
         {
          BoardText = " → <a href='index.aspx?BoardID="+ds1.Tables[0].Rows[0]["BoardID"].ToString()+"' >"+ds1.Tables[0].Rows[0]["BoardType"].ToString()+"</a>";
         }
         BoardText = GetBoardPostioinRec(Convert.ToInt32(ds1.Tables[0].Rows[0]["ParentID"])) + BoardText;
        }
        ds1.Clear();
       }
       return BoardText;
      }
  • 相关阅读:
    AutoLISP圆内接多边形
    AutoLISP以直线为基线添加文字
    jquery easyuidatagrid 如何清空数据
    MyBatis直接执行SQL查询及批量插入数据
    mappers文件中的#{}语法与${}语法的区别
    在windows7桌面上新建一个快捷方式,指向cmd命令窗口
    ResultSet转换List或直接遍历解决null问题
    linux命令
    flash build 4.6 报错 内存不足,无法加载...
    关于linux安装openoffice无法启动
  • 原文地址:https://www.cnblogs.com/kingeric/p/616542.html
Copyright © 2020-2023  润新知