December 1, 2015

How to obtain the URL to an item in Sitecore

We use LinkManager to get item Url in Sitecore.
Lets see below one example.

Item item = Sitecore.Context.Database.GetItem("/sitecore/Content/Home/Page1");
string link = LinkManager.GetItemUrl(item);

That's it.
Enjoy Learning.

No comments:

Post a Comment