More in this section

Forums / Developing with Sitefinity / How to implement base page?

How to implement base page?

3 posts, 1 answered
  1. Ian
    Ian avatar
    75 posts
    Registered:
    25 Oct 2010
    31 Aug 2011
    Link to this post
    Hello
    Is there any documentation on how to implement a base page in Sitefinity 4.2? I can't find any reference to it beyond the release notes.
    Thanks
    Ryan
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    31 Aug 2011
    Link to this post
    I've experimented with this a bit myself, and it was pretty straightforward.

    Simply create a class that inherits from Page:

    namespace SitefinityWebApp.Pages
    {
        public class BasePageClass : Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                // do stuff!
            }
        }
    }

    Then in Sitefinity, open the Title and Properties for the page you want to set the base and at the bottom input that base page class (be sure to include the full namespace).

    See the attached screenshot for how I did it.

    Currently you need to set it per page, but I believe a global base page is in the works for a future release. I'll send your feedback to the documentation team so that we can include this in the developer manual.

    Hope this was helpful!
    Answered
  3. Ian
    Ian avatar
    75 posts
    Registered:
    25 Oct 2010
    01 Sep 2011
    Link to this post
    Thanks! That's what I was looking for. All working great now.

    Ryan
3 posts, 1 answered