+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Getting page ID

Getting page ID

2 posts, 0 answered
  1. higgsy
    higgsy avatar
    336 posts
    Registered:
    05 Aug 2010
    06 Dec 2010
    Link to this post
    Hi,

    I want to get the pageID from a list of the pages within the sitemap. I referred to:

    http://www.sitefinity.com/devnet/forums/sitefinity-3-x/developing-with-sitefinity/best-page-selector-for-custom-control.aspx

    Within the post, Gavin mentioned he had found a WebEditor called Telerik.Cms.Web.UI.CmsHyperLinkUrlWebEditor  that returns the pageID, however SiteFinity support referenced the web editor WebEditor("Telerik.Cms.Web.UI.DhlIdEditor, Telerik.Cms").

    Is there any reason to use one mthod over the other? Is one depreciated for example?

    Thanks
    higgsy
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Dec 2010
    Link to this post
    Hello higgsy,

    You can use the selector as a property

    [UrlProperty, WebEditor("Telerik.Cms.Web.UI.DhlUrlEditor, Telerik.Cms"), Bindable(true), Category("Custom"), DefaultValue("")]
       publicstringNavigateUrl
       {
           get
           {
               returnthis.navigateUrl;
           }
           set
           {
               this.navigateUrl = value;
           }
       }
      
     
       [TypeConverter("Telerik.Cms.Web.UI.GuidTypeConverter, Telerik.Cms"), WebEditor("Telerik.Cms.Web.UI.DhlIdEditor, Telerik.Cms"), Category("Navigation"), DefaultValue(typeof(Guid), "00000000-0000-0000-0000-000000000000")]
       publicGuid PageId
       {
           get
           {
               returnthis.pageId;
           }
           set
           {
               this.pageId = value;
           }
       }

    The post shows a custom page selector, but you can use the above one which is used by DynamicHyperLink control.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered