Click here to Skip to main content
15,880,469 members
Articles / Web Development / ASP.NET

Web Page Extensions to Associate Domain Models With Web Forms

Rate me:
Please Sign up or sign in to vote.
4.53/5 (4 votes)
29 Jan 2011CPOL3 min read 30.4K   13  
An extension type associates an ASPX view page with a domain model object.
namespace WebPageExtensionSample.Model
{
    using System.ComponentModel;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    public class Category
    {
        public int Id { get; set; }
        [DisplayName("Category name: ")]
        [Required(ErrorMessage = "Category name is required.")]
        public string Name { get; set; }
        [DisplayName("Parent category: ")]
        public int ParentId { get; set; }        
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Cognizant Technology Solutions
India India
I work as a Technology Specialist in Cognizant Technology Solutions. I have 1.5 decades of experience in Software Development and focuses on Microsoft Web Technologies, JavaScript Frameworks, Azure Services and DevOps

Comments and Discussions