More in this section

Forums / General Discussions / Creating a Control

Creating a Control

2 posts, 1 answered
  1. Stuart Hemming
    Stuart Hemming avatar
    144 posts
    07 Jul 2004
    15 May 2011
    Link to this post
    I'm working through the examples in the docs for creating a custom control.

    The documentation says ...

    In Sitefinity, you can create your controls as standard ASP.NET custom controls or you can derive them from one of the built-in base classes - SimpleView, SimpleScriptView.

    However, all of the follow documentation assumes that you are, in fact, deriving from SimpleView.

    I would like to know how you proceed if you aren't going to do that. Specifically I want to know how to reference the template I create in my control. The examples suggest writing something like this ...

    protected virtual RadRotator RadRotator1
            return base.Container.GetControl<RadRotator>("RadRotator1", true);

    Except, I believe, Container is a property of SimpleView

    How do I reference my template if I'm not using it?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    16 May 2011
    Link to this post
    Hi Stuart,

    We have a control traverser that loops through controls collection which allows you to reference the control from the template as shown above. If you don't inherit from SimpleView or our controls you need to implement your own way for mapping templates and finding controls. In this case you can inherit from CompositeControl and implement INamingContainer.

    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
2 posts, 1 answered