asp.net theme (theme) and the use of skin (skin) __.net

Source: Internet
Author: User
Tags border color
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>

<asp:textbox runat= "Server" skinid= "new" backcolor= "#FFCC99" bordercolor= "#FF6600" borderstyle= "dotted" Borderwidth= "2px" ></asp:TextBox>

Example 1:

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
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.