In Asp.Net Webforms the controls generate an output in html controlled by Asp.Net itself, as follows:
the Asp.net tag:
<asp:CheckBoxList id="check1" AutoPostBack="True" TextAlign="Right" OnSelectedIndexChanged="Check" runat="server">
<asp:ListItem>Item 1</asp:ListItem>
<asp:ListItem>Item 2</asp:ListItem>
</asp:CheckBoxList>
Generates an html output of:
<table id="check1">
<tr>
<td><input id="check1_0" type="checkbox" name="check1$0" onclick="javascript:setTimeout('__doPostBack(\'check1$0\',\'\')', 0)" value="Item 1" /><label for="check1_0">Item 1</label></td>
</tr><tr>
<td><input id="check1_1" type="checkbox" name="check1$1" onclick="javascript:setTimeout('__doPostBack(\'check1$1\',\'\')', 0)" value="Item 2" /><label for="check1_1">Item 2</label></td>
</tr>
</table>
In every Webcontrol control it is possible to define a Css through the Cssclass="string" property, for example:
<asp:TextBox id="TextBox1" ForeColor="Red" CssClass="minhaClassCSS" />
output:
<input type=text class="minhaClassCSS" style="ForeColor:red">
Unfortunately it is not easy to know how each Webcontrol control will be generated in HTML, that is, Webforms facilitates the life of the programmer in the construction of the layout but takes away from it the power to manipulate it. This is a great advantage of Asp.net MVC the power goes back to the programmer but now it is your responsibility to write a well done HTML.
In case you use Twitter-Bootstrap with Webforms there is no easy way, you will need to create the classes in your css similar to the one you want to use from Bootstrap and hope that the output of your controls are compatible.
Source: MSDN
Which version of bootstrap you plan to use?
– Miguel Angelo
Is it something legacy? If it’s something new I recommend using MVC, you have more freedom in the presentation.
– Tiago César Oliveira
It’s legacy, all right, man.
– Alan R. Soares