Create the widget template

Create the markup for displaying the settings. The settings render a dropdown with choices for the user.

To do this, perform the following:

  1. Open your project in Visual studio.
  2. Create a file and name it MyCustomSettings.ascx
  3. Inside paste the following code:
    ASP.NET
    <%@ Control Language="C#" %>
    <%@ Register Namespace="Telerik.Sitefinity.Web.UI.Fields" TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" %>
    
    <h2>
        <asp:Literal runat="server" ID="lGeneralSettings" Text="Custom Basic Settings" />
    </h2>
    
    <sitefinity:ChoiceField 
        ID="randomVariable" 
        runat="server"
        DisplayMode="Write" 
        DataFieldName="RandomVariable"
        Title="Random Variable"
        CssClass="sfSettingsSection"
        RenderChoicesAs="DropDown" />
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
New to Sitefinity?