niisar
10/17/2014 - 9:18 AM

Why does ASP.Net RadioButton and CheckBox render inside a Span?

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");