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

Forums / General Discussions / Custom base page

Custom base page

5 posts, 0 answered
  1. Andreas
    Andreas avatar
    49 posts
    Registered:
    29 Dec 2007
    23 Mar 2011
    Link to this post
    Hola!

    There may be some obvious way or info that I'm missing but how do I go about implementing a "custom base page" in Sitefinity 4. Kinda like I always did replacing what kinda page cmsentrypoint.aspx inherited from in 3.x. I kinda like doing some stuff like setting themes programatically, authorization yada yada there.

    Anyone know right off the bat?

    //Andreas
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    23 Mar 2011
    Link to this post
    Hello Andreas,

    In Sitefinity 4.0 we use ASP.NET Routing

    http://msdn.microsoft.com/en-us/library/cc668201.aspx

    All page requests are processed by PageRouteHandler, so you can implement a custom handler that inherits from it and inject your logic.

    ObjectFactory.Container.RegisterType<PageRouteHandler, CustomRouteHandler>();

    We also use inversion of control, so this is the other option to executed some custom code. This could be done through ObjectFactory class and its methods

    Greetings,
    Ivan Dimitrov
    the Telerik team
  3. Andreas
    Andreas avatar
    49 posts
    Registered:
    29 Dec 2007
    23 Mar 2011
    Link to this post
    Thanks for the swift reply Ivan.
  4. Ryan Dailey
    Ryan Dailey avatar
    41 posts
    Registered:
    08 Mar 2010
    05 Jul 2011
    Link to this post
    Hey,
    I've been trying to find this particular overload for ObjectFactory.Container.RegisterType, but I have not been able to find it.  Has something changed in the latest version?  Thanks for your help.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    06 Jul 2011
    Link to this post
    Hi Ryan,

    ObjectFactory.Container.RegisterType is an extension of IUnityContainer (Telerik.Microsoft.Practices.Unity) and most probably you are missing a reference.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
5 posts, 0 answered