完善數(shù)據(jù)注解

到目前為止的表格頁(yè)面效果:

 

我們需要更多的數(shù)據(jù)注解,來(lái)限制各個(gè)屬性,以及提供顯示用的名稱(chēng)(而不是英文字符串):

photoshop培訓(xùn),電腦培訓(xùn),電腦維修培訓(xùn),移動(dòng)軟件開(kāi)發(fā)培訓(xùn),網(wǎng)站設(shè)計(jì)培訓(xùn),網(wǎng)站建設(shè)培訓(xùn)

public class Student {        public int ID { get; set; }          [Display(Name = "姓名")]        [Required]        [StringLength(200, MinimumLength = 2)]        public string Name { get; set; }  
        
		

網(wǎng)友評(píng)論