龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > asp.net编程 >

ASP.NET菜单用户控件:.NET无限级扩展菜单用户控件实现(3)

时间:2009-12-21 11:47来源:未知 作者:admin 点击:
分享到:
MenuInfo.cs 菜单实体类 1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 5 namespace Entity 6 { 7 /// summary 8 /// 菜单信息实体类 9 /// /summary 10 [Serializable]

MenuInfo.cs 菜单实体类

1 using System;
 2 using System.Collections.Generic;
 3 using System.Text;
 4
 5 namespace Entity
 6 {
 7     /// <summary>
 8     /// 菜单信息实体类
 9     /// </summary>
10     [Serializable]
11     public class MenuInfo
12     {
13         public int Id { get; set; }
14         /// <summary>
15         /// <summary>
16         /// 显示名称
17         /// </summary>
18         public string TitleCN { get; set; }
19         public string TitleEN { get; set; }
20        
21         /// <summary>
22         /// 控件的完整类名或者文件相对路径
23         /// </summary>
24         public string FilePath { get; set; }
25
26         public MenuInfo Parent { get; set; }
27
28         public List<MenuInfo> ChildMenuInfo { get; set; }
29
30         /// <summary>
31         /// 节点层级,数据库可有可无这个字段,实体类需要
32         /// </summary>
33         private int level;
34         public int Level
35         {
36             get { return level; }
37             set { level = value; }
38         }
39         /// <summary>
40         /// 是否显示在菜单栏中
41         /// </summary>
42         private bool? isVisibily;
43         public bool? IsVisibily
44         {
45             get { return isVisibily; }
46             set { isVisibily = value; }
47         }
48     }

 

使用以上源码即可实现无限级效果。


精彩图集

赞助商链接