# Create the code-behind

To do this, perform the following:

1. Add a class and name it `MyCustomSettings.cs`
2. In the class, paste the following code:
   ```C#
   using System.Web.UI;
   using Telerik.Sitefinity.Web.UI;
   using Telerik.Sitefinity.Web.UI.Fields;

   namespace SitefinityWebApp.CustomSettings
   {
       public class MyCustomSettings : SimpleView
       {
           #region Properties
           /// <summary>
           /// Obsolete. Use LayoutTemplatePath instead.
           /// </summary>
           protected override string LayoutTemplateName
           {
               get
               {
                   return string.Empty;
               }
           }

           protected override HtmlTextWriterTag TagKey
           {
               get
               {
                   //we use div wrapper tag to make easier common styling
                   return HtmlTextWriterTag.Div;
               }
           }

           /// <summary>
           /// Gets the layout template's relative or virtual path.
           /// </summary>
           public override string LayoutTemplatePath
           {
               get
               {
                   if (string.IsNullOrEmpty(base.LayoutTemplatePath))
                       return MyCustomSettings.layoutTemplatePath;
                   return base.LayoutTemplatePath;
               }
               set
               {
                   base.LayoutTemplatePath = value;
               }
           }
           #endregion

           #region Control References
           /// <summary>
           /// Reference to the Label control that shows the Message.
           /// </summary>
           protected virtual ChoiceField RandomVariable
           {
               get
               {
                   return this.Container.GetControl<ChoiceField>("randomVariable", true);
               }
           }
           #endregion

           #region Methods
           /// <summary>
           /// Initializes the controls.
           /// </summary>
           /// <param name="container"></param>
           /// <remarks>
           /// Initialize your controls in this method. Do not override CreateChildControls method.
           /// </remarks>
           protected override void InitializeControls(GenericContainer container)
           {
               this.RandomVariable.Choices.Add(new ChoiceItem { Text = "first option", Value = "first option" });
               this.RandomVariable.Choices.Add(new ChoiceItem { Text = "second option", Value = "second option" });
               this.RandomVariable.Choices.Add(new ChoiceItem { Text = "third option", Value = "third option" });
           }
           #endregion

           #region Private members & constants
           public static readonly string layoutTemplatePath = "~/MyCustomSettings.ascx";
           #endregion
       }
   }
   ```

> info **NOTE**: In the above class, you define the path to the template as virtual path.
