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

Custom Module

3 posts, 0 answered
  1. Paul Berger
    Paul Berger avatar
    61 posts
    Registered:
    03 Apr 2006
    11 Dec 2006
    Link to this post
    Hi Guys I have also been looking at doing my own custom control for sitefinity 3. It took a little for me to get my head around. I started by having a module class the implements WebModule, ISecuredModule, IRssFeedProvider

    public class JefModule : WebModule, ISecuredModule, IRssFeedProvider
    {
         //code here
    }

    I then also put in a section handler. I am not sure what this does exactly can someone please explain what this is for? It looks like it is for providers do we need to use this?

    class JefSectionHandler : ConfigurationSection
    {
        //Code Here
    }


    I am now up to doing a Toolbox Panel and Control Panel.

    class JefToolboxPanel : CompositeControl, IControlPanelCommand,
                                    IComponent, IDisposable,
                                    IParserAccessor, IUrlResolutionService,
                                    IDataBindingsAccessor, IControlBuilderAccessor,
                                    IControlDesignerAccessor, IExpressionsAccessor
    {

    }

    class JefControlPanel : CompositeControl, IControlPanel{ }

    My question is do I need to Implement all the interfaces in the Toolbox Panel?
    What is the minium interfaces I need to Implement?

    Am I on the correct path of creating a custom control?

    Also nearly forgot the mention that I have also create a few Toolbox Items:

    public class JefProductTreeToolBoxItem : ToolboxItem
        {
            JefProductTreeToolBoxItem() : base(typeof(JefProductTree))
            {
                base.DisplayName = "Base Display Name";
            }
        }
        [ToolboxData("<{0}:JefProductTree runat=server></{0}:JefProductTree>")]
        public class JefProductTree : CompositeControl
        {


  2. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    11 Dec 2006
    Link to this post

    Hello Paul,

    First I think it’s better to explain the terminology we are using to avoid any confusion. Any piece that is a UserControl (.ascx) or CustomControl in terms of ASP.NET we refer to as a control.
    Controls do not need to implement any specific interfaces in order to work with Sitefinity. You can add any type of controls to Sitefinity’s toolbox through the web.config.

    What you are describing here is what we refer to as a module. Modules are independent applications hosted by Sitefinity. Usually modules are comprised of groups of controls that work together to form some business logic. They are not required to use the same provider or configuration model as Sitefinity. The only interface that is required for a module in order to be hosted by Sitefinity is IWebModule. We will provide an example with detailed explanations of all aspects.

    Now let’s get your questions answered.

    Section handlers are used to read configuration settings from the web.config file.

    You are not required to use providers.

    Toolbox Panel and Control Panel are used in administration. No specific interfaces are required for Control Panel. ToolboxItem class is used to provide information for public controls. You are not required to have your own implementation of ToolboxItem. You can use it like this “new ToolboxItem(typeof(MyControl))”.

    It is a bit more complex implementing Toolbox Panel for the administration and I can’t explain it here.



    Best regards,
    Bob
    the telerik team
  3. Paul Berger
    Paul Berger avatar
    61 posts
    Registered:
    03 Apr 2006
    12 Dec 2006
    Link to this post
    Thankyou Bob.. You have cleared up a few things..
Register for webinar
3 posts, 0 answered