The ASP.net server-side controls provide a variety of styling designs, if each control is set separately, it is more tedious things, so Microsoft also provides for these server-side control style management, in fact, can also use CSS to control the style of some server-side controls, such as TextBox, if using the general CSS is the input Style control, but for the GridView or Calendar control, and so on, CSS files can not be flexible control, which requires Microsoft specifically for server-side control to provide the theme and skin.
How to use the theme and skin:
1, create a new skin file (*.skin), and then set the server-side control style in the file
2. Add the application of the appearance file to the page of the ASPX page, StyleSheetTheme or theme (the two are different)
The difference between StyleSheetTheme and theme:
For the default style (no SkinID style is defined), in the corresponding ASPX page theme will adopt the defined style, the style of the same property in the page is not valid; StyleSheetTheme allows you to redefine the style of the same property in the page and work. (Note: The same style as the attribute, such as the definition of height)
Example:
Let's say we created a skin file Newskin, which defines the style of a default textbox and the style of a textbox that specifies SkinID (background color, border color, width, and line type)
<asp:textbox runat= "Server" bordercolor= "#6699FF" backcolor= "#CCFFCC" borderwidth= "1px" borderstyle= "Solid" > </asp:TextBox>
Use theme in the ASPX page to introduce a skin file, and a control with four textbox on the page:
<%@ Page language= "C #" autoeventwireup= "true" codefile= "Default.aspx.cs" inherits= "Skin_default" theme= "Newskin"% >
Control 1:<asp:textbox id= "TextBox4" runat= "Server" ></asp:TextBox>
Control 2:<asp:textbox ID
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.