Get Umbraco Certified in October

5 courses in 4 different countries across 2 continents leaves no excuse.

Attend courses in the Netherlands, UK, USA and at Umbraco HQ in Denmark.

See the schedule and read more about our training here.

Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Matt Nolan 45 posts 65 karma points
    Feb 29, 2012 @ 18:26
    Matt Nolan

    Get property name


    Does anyone know how to get the Name (not alias) of a property in Razor?



  • Braydie276 karma points
    Mar 02, 2012 @ 15:57

    Hi Matt,

    If you are using a dynamic node you can just @MyDynamicNode.MyPropertyAlias and access it like that, or if you are using a regular Node, then you would do @MyNode.GetProperty("MyPropertyAlias")

    It's something like that! Hope I've pointed you in the right direction at least! :)

  • Braydie276 karma points
    Mar 02, 2012 @ 16:03

    Oops looks like I've misread your post!

  • Chris S.22 karma points
    Mar 02, 2012 @ 16:50
    Chris S.

    It's just Name, e.g.


    If you want to see all of them, you could try:


    @foreach (var child in DynamicModel.Children)
        <textarea rows="40" cols="40"> 
    @foreach(PropertyDescriptor descriptor in TypeDescriptor.GetProperties(child.ContentType)) 
    string name=descriptor.Name; 
    object value=descriptor.GetValue(child.ContentType); 
    @Html.Raw(name + "=" + value +"\n") } 

    This forum really doesn't like you pasting code in

  • zedna83 karma points
    1 week ago

    This doesn´t work when you need Name of Property

     foreach (var item in list)
                var proplist = item.Properties;
                foreach (var prop in proplist)
                    <li>@prop.PropertyTypeAlias (@prop.Name)</li>

    prop.Name doesn´t work in this case, but name is written somewhere in database. Can i uncover this field to be able to display it?

Please Sign in or register to post replies

Write your reply to:

Draft is the community mothership for Umbraco, the open source cms. With a friendly forum for all your questions, a comprehensive documentation and a ton of packages from the community. This site is running Umbraco version 7.3.0