title: custom web control html render
body: <p>This is my code , i created my custum radiobuttonlist. And it works but.. take a look at the code guys. Im using umbraco and C#</p>
  
  <pre><code>    using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Linq;
  using System.Text;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using umbraco;
  using umbraco.BusinessLogic;
  using umbraco.cms.businesslogic.member;
  using System.Web.Security;
  using umbraco.cms.businesslogic.web;
  using System.Collections;
  
  namespace RadioButtonList
  {
  
      [DefaultProperty("Text")]
      [ToolboxData("&lt;{0}:RadioButtonList runat=server&gt;&lt;/{0}:RadioButtonList&gt;")]
      public class RadioButtonList : System.Web.UI.WebControls.RadioButtonList
      {
          [Bindable(true)]
          [Category("Appearance")]
          [DefaultValue("")]
          [Localizable(true)]
  
          private void populate()
  
      {
          foreach (umbraco.cms.businesslogic.Dictionary.DictionaryItem d in umbraco.cms.businesslogic.Dictionary.getTopMostItems)
          {
              if (d.hasChildren)
              {
                  foreach (umbraco.cms.businesslogic.Dictionary.DictionaryItem d1 in d.Children)
                  {
                      if (d1.hasChildren)
                      {
                          if (d1.Value(1) == "Target Groups")
                          {
                              SortedList list = new SortedList();
                              foreach (umbraco.cms.businesslogic.Dictionary.DictionaryItem d2 in d1.Children)
                              {
                                  string translation;
                                  int lang = umbraco.library.GetCurrentDomains(umbraco.presentation.nodeFactory.Node.GetCurrent().Id)[0].Language.id;
                                  translation = "";
                                  translation = new umbraco.cms.businesslogic.Dictionary.DictionaryItem(d2.key).Value(lang);
  
                                  list.Add(translation, d2.key);
  
  
  
                              }
                              this.DataSource = list;
                              this.DataValueField = "value";
                              this.DataTextField = "key";
                              this.DataBind();
  
  
                          }
  
                      }
                  }
  
              }
          }
      }
  
  
          protected override void OnPreRender(EventArgs e)
  
          {
  
              base.OnPreRender(e);
  
              populate();
  
          }
  
      }
  </code></pre>
  
  <p>It works i can get the new web control but i want to "control" the render html. My RadioButtonList renders a span but i dont want it cause it create some issues. I already tryed this </p>
  
  <pre><code>protected override void Render(HtmlTextWriter writer)
  {
  RenderContents(writer);
  }
  </code></pre>
  
  <p>But when i use this my radiobuttonlist disappears and i cant see it anymore. I really need help cause im new to this and its my 1st time using custum server controls.</p>