Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.
Documentation for this section has not yet been entered.
Use the WebControl.CssClass property to specify the CSS class to render on the client for the Web Server control. This property will render on browsers for all controls. It will always be rendered as the class attribute, regardless of the browser.
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.
For example, suppose you have the following Web server control declaration:
Example
<asp:TextBox id="TextBox1" ForeColor="Red" CssClass="class1" />
The following HTML is rendered on the client for the previous Web server control declaration:
Example
<input type=text class="class1" style="ForeColor:red">
If you use cascading style sheets (CSS) to customize the appearance of a control, use either inline styles or a separate CSS file, but not both. Using both inline styles and a separate CSS file could cause unexpected results.
On browsers that do not support CSS, setting the WebControl.CssClass property will have no effect.