大家好!在一个mainform.aspx#里,有如下的代码,这说明在这个aspx代码里还去连接了javascript脚本,请问,在整个代码里,有没有执行dtree.js这个脚本,哪句代码是执行了这个脚本啊。这个dtree.js脚本就是会建立一个树型菜单,浏览的时候能显示出来,我如果要在这个菜单里增加几个子项怎么增加啊。就是<asp:Literal ID="litMenu" runat="server" Text="litMenu" />这个里面的菜单子项。谢谢大家啊,不好意思,初学表达得比较混乱,见笑了。在线等啊。下面是该页的源代码和,dtree.js的代码,太长了,不能把dtree.js发完整。<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainFrom.aspx.cs" Inherits="NetBasic.UI.Manage.MainFrom" %><html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>35互联定制型网站后台管理系统</title>
    <link href="css/mainFrom.css" rel="stylesheet" type="text/css" />
    <link href="css/loading.css" rel="stylesheet" type="text/css" />
    <link rel="StyleSheet" href="images/tree/dtree.css" type="text/css" />
    <script type="text/javascript" src="js/dtree.js"></script>
    <script language="javascript" type="text/javascript" src="js/common.js"></script>
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/DivDialog.js"></script>
    <script type="text/javascript" src="js/Dialog.js"></script>
    <script language="javascript" type="text/javascript">
    //点击刷新
    var Dialog_Btn_Refresh = "点击刷新";
    //Div对话框提交按钮
    var Dialog_Btn_Submit = "确  定";
    //Div对话框取消按钮
    var Dialog_Btn_Cancel = "取  消";
    //Div对话框关闭按钮
    var Dialog_Btn_Close = "";
    //退出系统的标题
    var Logout_Title = "退出DCMS内容管理系统";
    //Logout_Msg
    var Logout_Msg = "您确定要退出DCMS内容管理系统吗?";
    //消息头文字
    var SysMsgTitle = "友情提示";
    //当前正在加载的页面I
    var loadingIframeId = "";
    //当前正在加载的页面Url
    var loadingRrl = "";
    function Logou(){
        top.location.href="Default.aspx?action=logout";
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="wrapper" id="layout" style="WIDTH: 100%; HEIGHT: 100%">
      <!--头部定义-->
      <div id="TopFrom" class="topbg">
        <div class="logo">
          <img height="64" src="images/logo.gif" width="262" alt="" />
        </div>
        <div id="right">
          <table cellspacing="0" cellpadding="0" width="400" align="right" border="0">
            <tr>
              <td>
                <div class="welcom" style="HEIGHT: 20px">
                  <div style="FLOAT: right; MARGIN-LEFT: 5px">
                    <input class="top_button" type="button" value="退出" name="top_button" onClick="window.location.href='Default.aspx?action=logout';"/>
                  </div>
                  <div style="FLOAT: right; COLOR: #fff; LINE-HEIGHT: 19px">
                    <script type="text/javascript"></script>
                    <asp:Literal ID="litName" runat="server" /><asp:Label ID="lblUser" ForeColor="red" runat="server"
                        Text="Label"></asp:Label>,欢迎您![当前正在管理“ <asp:Label  ID="labLang" runat="server" ForeColor="#FF6600" />”站点内容] 
                  </div>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <div class="nav" style="FLOAT: right; WIDTH: 400px">
                
                  <div style="FLOAT: right; MARGIN: 0px 6px">
                    <img src="images/top-line.gif" alt="" />
                  </div>
                  <div class="list">
                    <a href="MainFrom.aspx">后台首页 </a>
                  </div>
                  <div style="FLOAT: right; MARGIN: 0px 6px">
                    <img src="images/top-line.gif" alt="" />
                  </div>
                  <div class="list">
                    <a href="../" target="_blank">前台首页 </a>
                  </div>
                  <div style="FLOAT: right; MARGIN: 0px 6px">
                    <img src="images/top-line.gif" alt="" />
                  </div>
              <asp:Literal ID="ltlSuper" Visible="false" Text="SUPER" runat="server"></asp:Literal>
                  <div style="FLOAT: right; MARGIN: 0px 6px">
                    <img src="images/top-line.gif" alt="" />
                  </div>
                  <asp:Literal ID="Lit_Lang" runat="server" />
                </div>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <!--头部结束-->
      
      <!--中间定义-->
      <div id="CenFrom">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="centTable">
          <tr>
            <td style="width:196px; height:100%;" valign="top" align="left">
              <div id="leftMenu">
                <div id="MenuBottom"><img src="images/menu_topimg.gif" width="182" height="2" alt="" /></div>
                <asp:Literal ID="litMenu" runat="server" Text="litMenu" />
                <div id="div9"><img src="images/menu_bottomimg.gif" alt="" width="182" height="2" /></div>
              </div>
              <div style="MARGIN-TOP: 12px; PADDING-LEFT: 11px">
                <img src="images/servicezhgb2312.gif" alt="" />
              </div>
            </td>
            <td valign="top" align="left" id="Maintable" style="height:100%;">
              <div class="content" id="div_Main">
                <div id="div_Main_Page">
                  <!--页面访问导行开始-->
                  <div style="position:absolute; left:189px; top: 64px;"><img src="images/left-top-right.gif" alt="" /></div>
                  <div id="nav">
                  </div>
                  <!--页面访问导行结束-->
                  <!-----主体内容开始----->
                  <div style="height:600px;">
                  <iframe id="ifmmainframe" name="ifmmainframe" src="Welcom.aspx" frameborder="0" scrolling="auto" width="100%" height="100%"></iframe>
                  </div>
                  <!-----主体内容结束----->
                </div>
              </div>
            </td>
          </tr>
        </table>
      </div>
      <!--中间结束-->
      
      <!--底部定义-->
      <div id="BottomFrom" class="bottombg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td style="width:18%"><img src="images/buttom-left.gif" width="198" height="54" alt="" /></td>
            <td width="67%" align="center" class="copyright">Copyright © 2004-2009 35 Technology Co., 
            Ltd. All Rights Reserved.</td>
            <td width="15%" align="right"><img src="images/buttom-right.gif" width="161" height="54" alt="" /></td>
          </tr>
        </table>
      </div>
      <!--底部结束-->
    </div>    </form>
</body>
</html>// Node objectfunction Node(id , pid, name , Station , url, title, target, icon, iconOpen,open) {
this.id = id;

this.pid = pid; this.name = name;

this.Station=Station; this.url = url; this.title = title; this.target = target; this.icon = icon; this.iconOpen = iconOpen; this._io = open || false; this._is = false; this._ls = false; this._hc = false; this._ai = 0; this._p;};// Tree objectfunction dTree(objName) { this.config = { target : null, folderLinks : true, useSelection : true, useCookies : true, useLines : true, useIcons : true, useStatusText : false, closeSameLevel : false, inOrder : false } this.icon = { root : 'images/tree/base.gif', folder : 'images/tree/folder.gif', folderOpen : 'images/tree/folderopen.gif', node : 'images/tree/page.gif', empty : 'images/tree/empty.gif', line : 'images/tree/line.gif', join : 'images/tree/join.gif', joinBottom : 'images/tree/joinbottom.gif', plus : 'images/tree/plus.gif', plusBottom : 'images/tree/plusbottom.gif', minus : 'images/tree/minus.gif', minusBottom : 'images/tree/minusbottom.gif', nlPlus : 'images/tree/nolines_plus.gif', nlMinus : 'images/tree/nolines_minus.gif' }; this.obj = objName; this.aNodes = []; this.aIndent = []; this.root = new Node(-1); this.selectedNode = null; this.selectedFound = false; this.completed = false;};// Adds a new node to the node arraydTree.prototype.add = function(id, pid, name , Station , url, title, target, icon, iconOpen, open) { this.aNodes[this.aNodes.length] = new Node(id, pid, name , Station , url, title, target, icon, iconOpen, open);};// Open/close all nodesdTree.prototype.openAll = function() { this.oAll(true);};dTree.prototype.closeAll = function() { this.oAll(false);};// Outputs the tree to the pagedTree.prototype.toString = function() { var str = '<div class="dtree">\n'; if (document.getElementById) { if (this.config.useCookies) this.selectedNode = this.getSelected(); str += this.addNode(this.root); } else str += 'Browser not supported.'; str += '</div>'; if (!this.selectedFound) this.selectedNode = null; this.completed = true; return str;};

解决方案 »

  1.   

    好长你要看dtree.js里面的方法 多看看dtree.js的DEMOhttp://www.cnblogs.com/lushuicongsheng/archive/2010/11/12/1876065.html
      

  2.   

    请问,在整个代码里,有没有执行dtree.js这个脚本,哪句代码是执行了这个脚本啊。看看哪个JS方法与dtree.js中的方法同名,就是哪个调用了。
      

  3.   


    在一个mainform.aspx#里,有如下的代码,这说明在这个aspx代码里还去连接了javascript脚本,请问,在整个代码里,有没有执行dtree.js这个脚本,哪句代码是执行了这个脚本啊。这个dtree.js脚本就是会建立一个树型菜单,浏览的时候能显示出来,我如果要在这个菜单里增加几个子项怎么增加啊。就是<asp:Literal ID="litMenu" runat="server" Text="litMenu" />这个里面的菜单子项。看来了半天没看出你想要干嘛?
      

  4.   

    调试JS看看
    dtree