Telerik Sitefinity- Retrieving a page by it’s URL or GUID- or finding a page’s GUID from its URL!

I recently started work at my new job, and here we use Telerik Sitefinity as the CMS for some websites.  I was recently tasked with writing some code which involved supplying the end url for a page, and then matching this against the corresponding record in the CMS- after much searching I found nothing and eventually got a response from their support so figured i would blog it!

var url = "~/test2.aspx";

var Manager = new CmsManager();
int totalRows;
List conditions = new List();
CmsSiteMapNode node = (CmsSiteMapNode)SiteMap.Provider.FindSiteMapNode(url);

// here is the GUID for the page
var pageId = new Guid(node.Key);

conditions.Add(new CmsQueryCondition("ID", Nolics.ORMapper.Base.QueryCondition.EQ, pageId));
// and here is the page
var result = Manager.GetPages(0, 0, string.Empty, System.ComponentModel.ListSortDirection.Descending, conditions, out totalRows);
  1. No comments yet.
(will not be published)

I absolutely love these. They came at the lace wigs are good quality, and very soft. Absolutely love these extensions. I just love this hair. Hair came on time, I waited until after hair extensions uk very full, no shedding and it is been installed for 3 weeks now and yes I jus ordered 3 more bundles. Lol. I definitely recommend this company for your bundles ladies. They are soft, hair bundles on the head for human hair wigs and I would continue to recommend them. I have thinner hair so they cover and blend nicely.