Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Yovav Gad 41 posts 62 karma points
    Jul 26, 2010 @ 19:51
    Yovav Gad
    0

    How to inherit from a base class in Umbraco ?

    Dear Umbraco,

    I've created a BasePage and a BasePageSecure classes to be used in order to add a layer of security,

    It seems like all Umbraco pages already inherit from umbraco.presentation.masterpages.umbracoPage

    (as I saw in umraco/masterpages/umbracoPage.Master)

    Assuming I have access to the original Umbraco DLL solutions - how can I make specific pages to inherit from the BasePage class and other pages to inherit from the BasePageSecure using the same masterpage (template) ?

    Or - maybe I can specify somewhere in the code of each page something like this:

    Inherits="MyFramework.Web.BaseClasses.BasePageSecure"

    (I'm not sure where can I type this code - as I didn't see the where is the code of each page)

    Thanks in advance. Yovav.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jul 27, 2010 @ 00:48
    Aaron Powell
    0

    A "page" in Umbraco doesn't really exist so you can't make it inherit from anything. What you have to do is make the Template (aka, Master Page) inherit from the type you require.

    Alternatively you can create base types for your Umbraco .NET macros and have them all inherit from your custom types.

Please Sign in or register to post replies

Write your reply to:

Draft