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.
Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Does anyone know how to get the Name (not alias) of a property in Razor?
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! :)
Oops looks like I've misread your post!
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))
@Html.Raw(name + "=" + value +"\n") }
This forum really doesn't like you pasting code in
This doesn´t work when you need Name of Property
foreach (var item in list)
var proplist = item.Properties;
foreach (var prop in proplist)
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?
Write your reply to:
Image will be uploaded when post is submitted