Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Felipe Lima

Felipe Lima felipecsl Me :)

Niner since 2009

  • Hanselminutes on 9 - ASP.NET MVC 2 Preview 1 with Phil Haack and Virtual Scott

    @cody.skidmore and @Mesfin:

     

    You can create a partial class for your Model and add a metadata class to it. Then, you replicate your Model's properties in the metadata class and decorate them with your attributes.

    Example:

    [MetadataType(typeof(MyModelMetadata)]

    public partial class MyModel

    {

        public class MyModelMetadata

        {

            [DisplayName("My property 1")]

            [UIHint("SomeTemplate")]

            public object MyModelProp1 {get; set; }

     

            [DataType(DataTypes.PhoneNumber)]

            public object MyModelProp1 {get; set; }

    }

     

    BTW, thanks for the great screencast. I loved the interview style as well. I was confused between LabelFor and DisplayFor. Very clear now Smiley

  • C# 4.0 New Features - Optional Parameters

    Can someone provide a working video for this post? This one is broken!

    Thanks!