这是我的课:
Imports System.ComponentModel.DataAnnotations
Public Class Class1
Public Property id As Integer
<Required(ErrorMessage:="First Name is required.")> _
<Display(Name:="fname")> _
<MaxLength(10)> _
Public Property fname As String
<Required(ErrorMessage:="Last Name is required.")> _
<Display(Name:="lname")> _
<MaxLength(12)> _
Public Property lname As String
<Range(100000, 1200000)>
Public Property salary As Decimal
End Class
是否可以在 ASP.NET WebForms 的部分类中使用数据注释?