this is my CLASS:
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
Is possible to use data annotations in partial Class in ASP.NET WebForms?
You need to use the full MVC architecture. This is your model and you can pass it into the Partial View as a parameter.
There are many tuorials on MVC and partial views – try this one http://rachelappel.com/razor/partial-views-in-asp-net-mvc-3-w-the-razor-view-engine/ or any of the official MVC tutorials
There are also plenty of examples on Stack Overflow.
Good luck