More in this section

Forums / Developing with Sitefinity / Get HomePage GUID

Get HomePage GUID

3 posts, 0 answered
  1. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    15 Oct 2008
    Link to this post
    Hi there guys,

    I need to get the home page id to compare it against the current page id to determine if the current request is the home page of the site...

    I found this post regarding this: http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bggmdm.aspx however HomePageID no longer seems to be a member of UrlHelper class in version 3.5...

    in addition to this the API references seem to also be incorrect in this regard...

    That said, i have search high and low for how to determine if the current request is the home page or not... Could someone please tell me how to do this with version 3.5...

    Thanks,

    Nugs
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    15 Oct 2008
    Link to this post
    Hi Nugs,

    Here is an example how to get home page id in Sitefinity v3.5:

    private Guid GetHomePageId() 
        { 
            UrlHelper.HomePageInfo homePage = new UrlHelper.HomePageInfo(); 
     
            return homePage.ID; 
        } 

    Hope this helps.

    Sincerely yours,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    15 Oct 2008
    Link to this post
    Thanks Pepi,

    I was actually playing with this class yesterday as i figured it was the replacement class for the HomePage members... But it was late and must have just glossed over it...

    Thanks, that worked...

    Nugs
Register for webinar
3 posts, 0 answered