asp.net Simple Configuration Tutorial _ Practical Tips

Source: Internet
Author: User
The theme is similar to CSS but he can provide some features that CSS cannot provide

---------------theme is based on control rather than HTML (subject allows and reuses almost all attributes)

---------------theme applied on the server

---------------can apply a theme through a configuration file

---------------topics don't overlap like css (if a theme and space define attributes at the same time, the definition of the theme overrides the properties of the control, which can also be modified)

The controls inside the topic cannot define IDs

Simple example

1, the site---Add a new Item---skin file (suffix named. skin)--select "Yes" to create a app_themes\skinname (your Subject name folder)

Then set the style in the file where you want to set the control like this:
Copy Code code as follows:

<%--
Preset panel. The following panels provide only examples of use.

1. Named Control Panel. SkinId should be the only definition, because in the same subject, a control type cannot have duplicate SkinId.
[Code]
<asp:gridview runat= "Server" skinid= "Gridviewskin" backcolor= "White" >
<alternatingrowstyle backcolor= "Blue"/>
</asp:GridView>

2. Preset panel. SkinId undefined. In the same topic, each control type can have only one preset control panel.

<asp:image runat= "Server" imageurl= "~/images/image1.jpg"/>
--%>
<asp:textbox runat= "Server" skinid= "test" width= "/>"
[/code]
Then on the page Use this topic like: Theme= "Your theme's name"
Copy Code code as follows:

<%@ Page language= "C #" autoeventwireup= "true" codefile= "WebForm1.aspx.cs"
inherits= "Test22.webform1" theme= "Testbox"%>

When you use a control, you can skinid= "the SkinID You set"
Copy Code code as follows:

<asp:textbox id= "TextBox1" skinid= "Test" runat= "Server" ></asp:TextBox>

If two files are not skinid This theme will be applied to all the corresponding controls on the interface

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.