I have a bunch of pages where each page has a Navigation control added, and each Navigation control has been configured with "Custom Selection of Pages." Now I need to change the URL of one link on all of them.
Is there any way to do this programmatically? Or do I have to do it manually through the admin UI?
Here's my attempt so far. I wanted to get the NavigationControl items and change the one link I'm looking for based on the anchor text. However once I have the PageControl I can't seem to cast it as a NavigationControl, and even if I could, I'm not sure how to access an individual link item.
var manager = PageManager.GetManager();
var pages = manager.GetPageNodes().Where(pn => pn.Parent.UrlName == "programs").ToList();
foreach (PageNode p in pages)
foreach (PageControl c in p.Page.Controls)
if (c.ObjectType == "Telerik.Sitefinity.Web.UI.NavigationControls.NavigationControl")
// next line errors with 'Cannot convert type'
NavigationControl nc = ((NavigationControl)c);