More in this section
Forums / Developing with Sitefinity / Add urls to programmatically created pages

Add urls to programmatically created pages

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Andrew
    Andrew avatar
    6 posts
    26 Jul 2007
    07 Aug 2007
    Link to this post

    If I create a page with code then how do I go about adding friendly urls to it?

    At the moment I am creating (Nolics)  CmsUrl objects and then adding them to the
    ICMSPage's  list of urls. This seems wrong to me as I am directly accessing the data layer

    is there a better way to do this?

  2. Vlad
    Vlad avatar
    498 posts
    19 Jun 2017
    08 Aug 2007
    Link to this post
    Hello Andrew,

    Here is a better way to add additional URL to a ICmsPage using Cms interfaces:

    using Telerik.Cms;     
    using Telerik.Cms.Web;     
        string url = "~/HomeFriendlyUrl.aspx";     
        // Add the URL only if it does not exists in the site     
        ICmsUrlContext urlContext = UrlHelper.GetUrl(this.ResolveUrl(url).ToLower(), true);     
        if (urlContext == null)     
            CmsManager manager = new CmsManager();     
            ICmsPage page = manager.GetPage(pageId, true);     

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered