Skip to content

Instantly share code, notes, and snippets.

@niisar
Created October 17, 2014 09:18
Show Gist options
  • Select an option

  • Save niisar/7c49a92053ee36796a8d to your computer and use it in GitHub Desktop.

Select an option

Save niisar/7c49a92053ee36796a8d to your computer and use it in GitHub Desktop.
Why does ASP.Net RadioButton and CheckBox render inside a Span?
► Web controls in the System.Web.UI.WebControls
► you should use the controls in the System.Web.UI.HtmlControls
as
<input type="checkbox" id="CheckBox1" runat="server" class="myClass" />
<input type="radio" name="RadioButton1" runat="server" class="myClass" />
<input type="text" id="TextBox1" runat="server" class="myClass" />
other tecnique
myCheckBoxControl.InputAttributes.Add("class", "myCheckBoxClass");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment