Simple configuration tutorial for ASP. NET topics

Source: Internet
Author: User

Theme is similar to css, but it can provide features that css cannot provide.

--------------- The topic is based on controls rather than HTML (the topic allows setting and reusing almost all attributes)

--------------- The topic is applied on the server.

--------------- The topic can be applied through the configuration file.

--------------- The topic does not overlap like css (if a topic and space define attributes at the same time, the topic definition will overwrite the properties of the control, of course, this can also be modified)

The widget in the topic cannot define the ID.

Simple instance

1. Website --- add new item --- appearance file (suffixed with. skin) -- select "yes" to create an App_Themes \ skinName (folder of your topic name)

Set the control style in the file, for example:
Copy codeThe Code is as follows:
<% --
Set the source of the Panel. The following panel functions are used as examples.

1. Named control panel. SkinId should be unique, because in the same subject, a control type cannot have a duplicate SkinId.
[Code]
<Asp: GridView runat = "server" SkinId = "gridviewSkin" BackColor = "White">
<AlternatingRowStyle BackColor = "Blue"/>
</Asp: GridView>

2. Configure the panel. SkinId is not defined. In the same subject, each control plane must have only one Preset Control Panel.

<Asp: Image runat = "server" ImageUrl = "~ /Images/image1.jpg "/>
-- %>
<Asp: TextBox runat = "server" SkinId = "test" width = "20"/>
[/Code]
Use this topic on the page, for example, Theme = "name of your topic"
Copy codeThe Code is as follows:
<% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "WebForm1.aspx. cs"
Inherits = "Test22.WebForm1" Theme = "TestBox" %>

When using the control, you can set SkinID = "Your SkinID"
Copy codeThe Code is as follows:
<Asp: TextBox ID = "TextBox1" SkinID = "test" runat = "server"> </asp: TextBox>

If no SkinID is added to the two files, the topic is applied to all 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.