Click here to Skip to main content
13,146,014 members (41,542 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads

Stats

271.7K views
15.3K downloads
314 bookmarked
Posted 12 Jan 2013

MVC Basic Site: Step 1 – Multilingual Site Skeleton

, 25 Oct 2013
This article is intended to be the first one from this series and is focused mainly in the creation of a multilingual MVC web site skeleton.
MvcBasicSiteDatabase.bak
MvcBasicSiteSourceCode
MvcBasicSite
MvcBasic.Logic
MvcBasicSiteModel.edmx
Properties
MvcBasicSite
app_code
App_Data
App_GlobalResources
ClassDiagramUI.cd
Content
Images
dd_arrow.gif
flag_De.png
flag_En.png
flag_Ro.png
HeaderLogo.png
icon-arrow.gif
themes
base
images
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
Controllers
Global.asax
Models
MvcBasicSite.csproj.user
Properties
Scripts
Views
Account
Home
Shared
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Collections;
using System.Web.Mvc;

namespace MvcBasic.Logic
{
    /// <summary>
    /// Defines the address entity.
    /// </summary>
    [MetadataType(typeof(AddressValidation))]
    public partial class Address
    {

        /// <summary>
        /// Initializes a new instance of the Address class.
        /// </summary>
        public Address()
        {
            this.ID = 0;
        }
    }

    /// <summary>
    /// Defines the validation rules and messages for address entity.
    /// </summary>
    public class AddressValidation
    {
        [Required(ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationRequired")]
        [DataType(DataType.Text)]
        [StringLength(50)]
        public string FirstName { get; set; }

        [DataType(DataType.Text)]
        [StringLength(50)]
        public string LastName { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationRequired")]
        [RegularExpression(@"([A-Za-zäöüÄÖÜßăîâșțĂÎÂȘȚ\.\\/ ])+", ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationNumbersNotAllowed")]
        [DataType(DataType.Text)]
        [StringLength(100)]
        public string Town { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationRequired")]
        [DataType(DataType.Text)]
        [StringLength(200)]
        public string Street { get; set; }

        [RegularExpression(@"([0-9 \.\(\)/\\\-\+])+", ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationLettersNotAllowed")]
        [DataType(DataType.PhoneNumber)]        
        [StringLength(25)]
        public string Phone { get; set; }

        [RegularExpression(@"([0-9 \.\(\)/\\\-\+])+", ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationLettersNotAllowed")]
        [DataType(DataType.PhoneNumber)]
        [StringLength(25)]
        public string Fax { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationRequired")]
        [RegularExpression(@"(\d)+", ErrorMessageResourceType = typeof(Resource), ErrorMessageResourceName = "ValidationLettersNotAllowed")]
        [DataType(DataType.Text)]
        [StringLength(25)]
        public string ZipCode { 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 Microsoft Public License (Ms-PL)

Share

About the Author

Raul Iloc
Program Manager
Romania Romania
I am Project Manager with about 20 years working experience in software development and about 15 years as Software Project Manager and Architect.

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 25 Oct 2013
Article Copyright 2013 by Raul Iloc
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid