日期:2014-03-09 浏览次数:20590 次
首先模板treetemplate.htm文件如下:
<HTML>
<HEAD>
<title>tree</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" src="MzTreeView10.js"></script>
<link href="menutree/menu.css" type="text/css" rel="stylesheet">
<style> A.MzTreeview { PADDING-LEFT: 3px; FONT-SIZE: 12px } </style>
</HEAD>
<body leftmargin="0" topmargin="2">
<SCRIPT LANGUAGE="JavaScript">
window.tree = new MzTreeView("tree");
tree.setIconPath("menutree/"); //可用相对路径
abcdefg
document.write(tree.toString()); //亦可用 obj.innerHTML = tree.toString();
//-->
</SCRIPT>
</body>
</HTML>
好了,下面是页面managertre.aspx的代码:
<%@ Page language="c#" Codebehind="managertree.aspx.cs" AutoEventWireup="false" Inherits="hualong.manager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>管理中心</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="style.css" type="text/css" rel="stylesheet">
<script language="javascript">
<!--
function ShowJie()
{
TianJia.style.display = "";
}
function window.onload()
{
if(arr=document.cookie.match(/scrollTop=([^;]+)(;|$)/))
document.body.scrollTop=parseInt(arr[1]);
}
function window.onbeforeunload(){
document.cookie="scrollTop="+document.body.scrollTop;
}
//-->
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<br>
<table cellSpacing="0" cellPadding="0" width="350" border="0">
<tr>
<td align="center" width="50%"><INPUT type="button" value="添加节点"></td>
<td align="center"><asp:button id="btnTree" runat="server" Text="生成树"></asp:button></td>
</tr>
</table>
<table id="TianJia" style="DISPLAY: none; BORDER-COLLAPSE: collapse" borderColor="#6595d6"
cellSpacing="1" cellPadding="0" width="1000" align="center" border="1">
<tr>
<td align="center" width="60"><asp:button id="btnAddOk" runat="server" Text="添加"></asp:button></td>
<td align="center" width="50"><asp:textbox id="txtId" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center" width="50"><asp:textbox id="txtParentId" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center" width="120"><asp:textbox id="txtText" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center" width="120"><asp:textbox id="txtHint" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center" width="60"><asp:textbox id="txtIcon" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center"><asp:textbox id="txtData" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center" width="150"><asp:textbox id="txtUrl" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center" width="50"><asp:textbox id="txtTarget" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
<td align="center" width="120"><asp:textbox id="txtMethod" runat="server" Wrap="False" Width="100%"></asp:textbox></td>
</tr>