Whats the difference between .Url property and Umbraco.Url(1234)

When it comes down to it, the .Url property of an IPublishedContent object type, has already been loaded into memory, accessing it will be very quick, providing you've already loaded the node into memory for other purposes, where as the Umbraco.Url(nodeid) method will get the value for any defined node id.

When to use

Use the .Url property if you already have a node loaded into memory for other purposes, such as reading properties from it.

Use Umbraco.Url(nodeid) when you're just linking to a node and don't need any other properties from it.

So whats NiceUrl?

The NiceUrl property and associated Umbraco helper method are legacy and should not be used. Whilst they do work and haven't been marked obsolete, they may be removed in future versions of Umbraco.


Published at

Tags: Umbraco

Luke Alderton

Comments

Post a comment
Sit tight...
We're adding your comment.
Thank you.
Your comment has been added.
There's been a problem.
Please try again later.
Share with
Tags
Latest Comments
By jack of ass on Replacing the Xamarin Header/Navigation bar with a custom view/template
16 Feb 2019, 03:13 AM
By Zal on Xamarin MasterDetailPage has large margin/padding at top
7 Feb 2019, 12:20 PM
By AndrewEcopE1 on MVC forms in Umbraco
7 Feb 2019, 01:16 AM
By AndrewEcopE1 on MVC forms in Umbraco
4 Feb 2019, 23:53 PM
By Ramachandran on Reducing Umbraco memory usage by enabling 32-bit applications
4 Feb 2019, 17:39 PM
By encoderu9 on MVC forms in Umbraco
4 Feb 2019, 10:51 AM
By AndrewEcopE1 on MVC forms in Umbraco
28 Jan 2019, 19:48 PM
By Luca Ziegler on Xamarin Forms app not updating after deploy
25 Jan 2019, 11:00 AM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development