- Back to Home »
- CSHTML , Umbraco »
Posted by : Jebastin
Tuesday, 7 January 2014
The following Razor code is used to check whether an Umbraco Node has children or not.
- bool hasChildren = (Model.ChildrenAsList.Count() > 0);
- if(hasChildren)
- {
- //code
- }
- else
- {
- //code
- }