待搞清楚

 

各个的作用

 

   1:  
   2:  
   3:         [ReadOnly(true), Editable(false)]
   4:         //[ScaffoldColumn(false)]
   5:  
   6:  
   7:         [HiddenInput(DisplayValue = false)]
   8:         [EditorBrowsable(EditorBrowsableState.Advanced)]
   9:         public override int Id
  10:         {
  11:             get { return base.Id; }
  12:         }
  13:  
  14:         [HiddenInput(DisplayValue = false)]
  15:         public int CountryId { get; set; }
  16:  
  17:         [NopResourceDisplayName("Admin.Configuration.Countries.States.Fields.Name")]
  18:         [AllowHtml]
  19:         [DataType(DataType.Text), Required]
  20:         public string Name { get; set; }
  21:  
  22:         [NopResourceDisplayName("Admin.Configuration.Countries.States.Fields.Abbreviation")]
  23:         [AllowHtml]
  24:         [DataType(DataType.Text), Required]
  25:         public string Abbreviation { get; set; }
  26:  
  27:         [NopResourceDisplayName("Admin.Configuration.Countries.States.Fields.Published")]
  28:         [Required]
  29:         public bool Published { get; set; }
  30:  
  31:         [NopResourceDisplayName("Admin.Configuration.Countries.States.Fields.DisplayOrder")]
  32:         //we don't name it "DisplayOrder" because Telerik has a small bug 
  33:         //"if we have one more editor with the same name on a page, it doesn't allow editing"
  34:         //in our case it's state.DisplayOrder
  35:         [Required]
  36:         public int DisplayOrder1 { get; set; }
  37:  
  38:         #region LiuJ 2012-04-30 [2012-04-24_17:05]
  39:         [NopResourceDisplayName("Admin.Configuration.Countries.States.Fields.ParentStateID")]
  40:         [Editable(false)]
  41:         [HiddenInput(DisplayValue = false)]
  42:         [EditorBrowsable(EditorBrowsableState.Advanced)]
  43:         public int ParentStateID { get; set; }
  44:  
  45:         [NopResourceDisplayName("Admin.Configuration.Countries.States.Fields.ParentStateName")]
  46:         [UIHint("StateProvinceTree"), Required]
  47:         public string ParentStateName { get; set; }
  48:  
  49:         [HiddenInput(DisplayValue = false)]
  50:         [ReadOnly(true), Editable(false)]
  51:         [EditorBrowsable(EditorBrowsableState.Never)]
  52:         public string FamilyTree { get; set; }
  53:         #endregion
  54:  
  55:         [UIHint("StateProvinceTree"), Required]
  56:         public IList<StateProvinceLocalizedModel> Locales { get; set; }

 

 

[Editable(false)]   禁用编辑

ReadOnly(true) 只读,但显示编辑框

UIHint("StateProvinceTree",”MVC or HTML or More….”,”TableName”,”tb_user”,”ColName”,”User_ID”)    …???还不清楚

HiddenInput(DisplayValue = false)   编辑的时候就不见了

[ScaffoldColumn(false)]????

 

[EditorBrowsable(EditorBrowsableState.Never)]   设定 该对象在编辑器中的可见性,仅仅是可见性,不影响可用性,见下一篇.

参考  http://www.dotblogs.com.tw/lastsecret/archive/2010/07/11/16486.aspx

你可能感兴趣的:(待搞清楚)