How to add a new line into Display Attribute, Name field

前端 未结 2 1429
忘了有多久
忘了有多久 2021-01-25 17:47

I\'m working on an MVC3 application and am using data attributes for the display name fields on the screen. Below is a representative sample -

    [Required]
           


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-25 18:21

    [Required]
    [Display(Name = "Staff Id
    (format \"9999\")")] [StringLength(10)] [UIHint("StaffId")] public string StaffId { get; set; }

    and inside your StaffId.cshtml custom editor template:

    @model string
    @Html.Raw(ViewData.ModelMetadata.DisplayName)
    @Html.TextBox("")
    

提交回复
热议问题