2,最简单的树(自定义图标)
雁峰ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联建站的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:028-86922220(备注:SSL证书合作)期待与您的合作!
-----后台
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Text; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public string GetzNodes() { StringBuilder sb = new StringBuilder(); sb.Append(""); return sb.ToString(); } ////// 设置节点 /// /// id /// 父级id /// 名称 /// 是否是父节点? /// 是否展开? ///返回节点 private string SetParametes(string id, string pid, string name, bool parent, bool open = false) { //父节点的展开图标 string Popenpath = "../img/1_open.png"; //父节点的关闭图标 string Pclosepath = "../img/1_close.png"; //子节点的图标 string Cclosepath = "../img/2.png"; StringBuilder sb = new StringBuilder(); sb.Append("{"); sb.AppendFormat("id:{0},", id); sb.AppendFormat("pId:{0},", pid); sb.AppendFormat("name:\"{0}\",", name); if (open) { sb.AppendFormat("open: true,"); } if (parent) { sb.AppendFormat("iconOpen: \"{0}\",", Popenpath); sb.AppendFormat("iconClose: \"{0}\"", Pclosepath); } else { sb.AppendFormat("icon:\"{0}\"", Cclosepath); } sb.Append("},"); return sb.ToString(); } }
-----前台
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%=GetzNodes()%>
整合包下载:http://down.51cto.com/data/1967063
分享名称:2,最简单的树(自定义图标)
文章来源:http://azwzsj.com/article/jijgch.html