Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8501259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:09:40+00:00 2026-06-11T01:09:40+00:00

this is my CLASS: Imports System.ComponentModel.DataAnnotations Public Class Class1 Public Property id As Integer

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:09:42+00:00Added an answer on June 11, 2026 at 1:09 am

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this in VB 2010: Imports System.Text.RegularExpressions Public Class Form1 Private Sub Button1_Click(ByVal sender
This is my code for connection: Imports System.Data.SqlClient Public Class frm_edit_patient Dim con As
I have this class that contains vars for db connection; Imports Microsoft.VisualBasic Imports System.Data.SqlClient
Consider this simple AS3 class. package { import flash.display.Sprite; import flash.display.MovieClip; public class MySprite
I have created this user control. Imports SAAQ.Utl.W00692BaseControle Imports System.ComponentModel Imports System.Web.UI.WebControls Imports System.Web.UI
Imports System.Data.SqlClient Public Class Form3 Private cs As New SqlConnection(Data Source=HUSAIN-PC;Initial Catalog=final1;Integrated Security=True) Private
Reproduction: Imports System.ComponentModel Imports System.ComponentModel.DataAnnotations Module Module1 Sub Main() Dim type = GetType(Contact) TypeDescriptor.AddProviderTransparent(
Imports System Imports System.IO Imports System.Linq Namespace PhotoGalleryApp Partial Public Class Index Inherits System.Web.UI.Page
Imports System.Net Imports System.IO Public Class Form1 Public Function GetHTML(ByVal url As Uri) As
Imports System.Data.OleDb Public Class Log Private mConnectionString As String = Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))(CONNECT_DATA=(SID=xxx)(SERVER=DEDICATED)));User Id=xxx;Password=xxx; Dim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.