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 Ecake68 on MVC forms in Umbraco
16 Dec 2018, 16:11 PM
By Wowob43 on Restrict Umbraco Back Office by IP
16 Dec 2018, 10:21 AM
By Rosax69 on How does DNS work? For dummies!
15 Dec 2018, 16:44 PM
By Aroli61 on Using SQL DataTables to speed up database performance
15 Dec 2018, 09:02 AM
By Xasus39 on MVC forms in Umbraco
14 Dec 2018, 20:04 PM
By Shane on Xamarin Forms multiple instances of same app open
14 Dec 2018, 05:33 AM
By Apabu19 on Displaying text on a 16x2 LCD screen with a Raspberry Pi
13 Dec 2018, 18:26 PM
By Anuri66 on Using SQL DataTables to speed up database performance
13 Dec 2018, 13:52 PM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development