1.c#方法上面的[Browsable(false)]是干吗用的?

答案:标明此对象不可被浏览,这样它就不会出现在设计器的属性窗口里了

看如下代码:

   /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Property[@name="ImagePath"]/*'/>
        [Browsable(true), Category("Appearance"), ANPDescription("desc_ImagePath"), DefaultValue(null)]
        public string ImagePath
        {
            get
            {
                if (null != cloneFrom)
                    return cloneFrom.ImagePath;
                string imgPath = (string)ViewState["ImagePath"];
                if (imgPath != null)
                    imgPath = ResolveUrl(imgPath);
                return imgPath;
            }
            set
            {
                string imgPath = value.Trim().Replace("\\", "/");
                ViewState["ImagePath"] = (imgPath.EndsWith("/")) ? imgPath : imgPath + "/";
            }
        }

 

相关文章:

  • 2018-01-09
  • 2021-10-13
  • 2021-09-28
  • 2021-12-22
  • 2021-11-29
  • 2021-11-04
  • 2022-01-05
猜你喜欢
  • 2021-10-06
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2021-09-05
  • 2021-06-15
  • 2022-12-23
相关资源
相似解决方案