WebPart设置杂项

CS写法:

 1 private bool _IsExpertCheck;
 2         [WebBrowsable(true)]
 3         [Personalizable(true)]
 4         [WebDisplayName("是否按专家显示文件,默认为否")]
 5         [WebDescription("是否按专家显示文件,默认为否")]
 6         public bool IsExpertCheck
 7         {
 8             get { return _IsExpertCheck; }
 9             set { _IsExpertCheck = value; }
10         }
11 
12         protected override void CreateChildControls()
13         {
14             Control control = Page.LoadControl(_ascxPath);
15             if (control != null)
16             {
17                 ((D_ZoneLimitViewUserControl)control).WebPart = this;
18             }
19             Controls.Add(control);
20         }


后台写法:

1 public D_ZoneLimitView WebPart { getset; }

 

posted @ 2014-10-10 14:41  Jakin.zhou  阅读(156)  评论(0编辑  收藏  举报