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 Zack on How to add a Xamarin Forms Loading Screen/Overlay
16 Feb 2018, 17:52 PM
By TimothyTow on MVC forms in Umbraco
14 Feb 2018, 16:17 PM
By TimothyTow on MVC forms in Umbraco
14 Feb 2018, 15:59 PM
By Jungle on Replacing the Xamarin Header/Navigation bar with a custom view/template
5 Feb 2018, 22:23 PM
By efsef on Using Umbraco Route Hijacking and posting to it
31 Jan 2018, 16:38 PM
By Jonny G on Replacing the Xamarin Header/Navigation bar with a custom view/template
31 Jan 2018, 11:13 AM
By Ben Konop on Fixed: Visual Studio Xamarin - 'The ResolveLibraryProjectImports task failed unexpectedly'
29 Jan 2018, 20:02 PM
By Luke Alderton on Replacing the Xamarin Header/Navigation bar with a custom view/template
17 Jan 2018, 15:30 PM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development