看了https://mustache.github.io/你就知道mustache是非常强大的模板引擎,支持多种语言,下面是个简单入门例子:

MVC Model

 public class StudentModel
    {
        [Key]
        public int StuId { get; set; }

        [Display(Name = "姓名")]
        [StringLength(50)]
        [Required(ErrorMessage = "姓名必填")]
        public string StuName { get; set; }
         [StringLength(250)]
        [Display(Name = "住址")]
        [DataType(DataType.MultilineText)]
        //[Required(ErrorMessage = "住址必填")]
        public string Address { get; set; }

        [Display(Name = "年龄")]
        [Required(ErrorMessage = "年龄必填")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:c}")]
        public int Age { get; set; }
    }
StudentModel

相关文章:

  • 2022-12-23
  • 2021-05-10
  • 2021-11-05
  • 2021-09-04
  • 2021-11-21
  • 2021-11-08
猜你喜欢
  • 2021-12-13
  • 2021-11-15
  • 2021-11-21
  • 2021-10-09
  • 2022-01-05
  • 2021-10-19
相关资源
相似解决方案