Showing posts with label CSHTML. Show all posts
Working with Dynamic Pagination in ASP.NET
Pagination is a typical process in data display whereby large sets of data are broken into discrete sections for viewing, more often than not used in conjunction with some type of grid or list component.
CSHTML:
@using Smp.Web.Common;
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
.
How to get the Created & last Published date of a Node in Umbraco?
Using the following CSHTML code we can easily get the Created & last Published date of a Node in Umbraco.
To get the Created Date of an Umbraco Node:
@Model.CreateDate
To get the Last Published Date of an Umbraco Node:
@Model.UpdateDa.
How to check whether an Umbraco Node has children or not?
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
}.