DisplayName in new beta

Last post 05-09-2008 3:19 PM by davidebb. 5 replies.

Sort Posts:

  • DisplayName in new beta

    04-26-2008, 8:44 PM
    • Loading...
    • sennaman
    • Joined on 04-23-2008, 9:47 AM
    • Posts 2

    Hi,

     I was using displayname to control the names that appear in the column title in a list, but now, the column title is fixed. What happened to the displayname?

     Thanks

  • Re: DisplayName in new beta

    04-28-2008, 10:46 AM
    Answer
    • Loading...
    • davidebb
    • Joined on 06-11-2002, 8:31 AM
    • Redmond, WA
    • Posts 974
    • AspNetTeam

    That should work.  What does your DisplayName attribute look like?

    David

  • Re: DisplayName in new beta

    05-09-2008, 11:30 AM
    • Loading...
    • tlanier
    • Joined on 04-29-2008, 1:20 PM
    • Posts 67

    I'm also having trouble using the DisplayName Attribute. Also, DisplayName does not appear in Intellisense.

    Error 1 The type or namespace name 'DisplayName' could not be found (are you missing a using directive or an assembly reference?) 

    In the partial class:

    using System;

    using System.Linq;

    using System.ComponentModel.DataAnnotations;

    using System.Web.DynamicData;

    ...............
    	[DisplayName("Box")]
    	public object BoxRow
    	{
    		get
    		{
    			return _BoxRow;
    		}
    		set
    		{
    			_BoxRow = value;
    		}
    	}
    
     Tommy
  • Re: DisplayName in new beta

    05-09-2008, 12:42 PM
    Answer
    • Loading...
    • scothu
    • Joined on 12-10-2007, 1:54 AM
    • Redmond, WA
    • Posts 193
    • AspNetTeam

    There was already a DisplayName attribute in .NET and it is in the root on System.ComponentModel, not in our new DataAnnotations namespace. You can either do System.ComponentModel.DisplayName[""] or add a "using System.ComponentModel" at the top of the file.

    Scott Hunter
    PM, ASP.NET Team, Microsoft
  • Re: DisplayName in new beta

    05-09-2008, 1:00 PM
    • Loading...
    • tlanier
    • Joined on 04-29-2008, 1:20 PM
    • Posts 67

    Thanks Scott!

    You may want to add the using statement to your partial class file generated by the wizard.

    Tommy

     

  • Re: DisplayName in new beta

    05-09-2008, 3:19 PM
    • Loading...
    • davidebb
    • Joined on 06-11-2002, 8:31 AM
    • Redmond, WA
    • Posts 974
    • AspNetTeam

    You're right, we shoud do this.

    David

Page 1 of 1 (6 items)
Microsoft Communities
Page view counter