More in this section
Forums / Thunder / basic custom widget designer question

basic custom widget designer question

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Sheldon
    Sheldon avatar
    11 posts
    02 Oct 2013
    21 Feb 2014
    Link to this post
    Very new to Sitefinity so I am sure this will be a easy one (not for me).

    I used Thunder to create the default "Hello World" custom widget and designer ... just so I could play with it.   I called it "HelloWorldTest"

    The strange thing is, when I look at the code that is generated I see a basic  HelloWorldTest.ascx but without any code behind.    

    <%@ Control Language="C#" %>
    <asp:Label ID="MessageLabel" Text="Text" runat="server"/>

    There is also the designer and a HellowWorldTest.cs file, but I see no way in which these files are linked. 

    As expected, when I registered this widget in tools and placed it on a page it just displays "Text", and when it click "Edit" it gives me the standard designer without the "Message" property.

    Am I supposed to add some code behind to the ASCX file to bootstrap the registering of the custom property and designer?

    I have a feeling I am missing the obvious here, but have been struggling for a while.

    Any hints would be greatly appreciated.
  2. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    21 Jan 2015
    24 Feb 2014
    Link to this post
    Hello Sheldon,

    You have created a user control. More information about user control, you can find in Sitefinity documentation:

    If you look in your HelloWorldTest.cs file, you will find a field referencing the layout template path:
    public static readonly string layoutTemplatePath = "~/HelloWorldTest.ascx";

    which is used in LayoutTemplatePath property:
    public override string LayoutTemplatePath
            if (string.IsNullOrEmpty(base.LayoutTemplatePath))
                return HelloWorldTest.layoutTemplatePath;
            return base.LayoutTemplatePath;
            base.LayoutTemplatePath = value;

    You can also consider watch this nice video tutorial made by Gabe Sumners for User Controls and Control Designers in Sitefinity:

    I hope this helps.

    Vassil Vassilev
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered