Domanda

In my umbraco project, i require values in the "last Edited" tab, inside C# code.

enter image description here

How can i get those values?

Please Help, Thanks.

È stato utile?

Soluzione

It's quite simple. Here's one way of doing it:

// Assure the query is done to the root node, in this case I was on the root controller.

var recentUpdatedNodes = Model.Content.DescendantsOrSelf().OrderByDescending(x => x.UpdateDate).Take(50);

foreach (var node in recentUpdatedNodes)
{
    @node.Name
    @node.Url
    @node.Id
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top