How to: Define ASP. NET topics

Source: Internet
Author: User

Demo download http://download.csdn.net/source/551037

 

You can define your own page subject or global topic. A topic consists of multiple supported files, including the style sheet of the page appearance, the control exterior of the modification server control, and any other supported images or files that constitute the topic.

Create a page topic
    1. Create a new folder named app_themes on the website.

      Note:

      This folder must be named app_themes.

    2. Create a new sub-folder in the app_themes folder to save the topic file. The name of the subfolder is the topic name. For example, to create a topic named bluetheme, create a folder named \ app_themes \ bluetheme.

    3. Add the appearance, style sheet, and image files that make up the topic to the new folder.

Create a global topic
    1. Use the following path to create the themes Folder:

      Copy code

      Iisdefaultroot \ aspnet_client \ system_web \ version \ themes

      For example, if the default web root folder is located in c: \ Inetpub \ wwwroot on the Web server, the new themes folder may be:

      Copy code

      C: \ Inetpub \ wwwroot \ aspnet_client \ system_web \ version \ themes

      Note:

      The folder Name of the global topic is themes rather than app_themes, because the latter is used for the page topic.

    2. Create a themes folder. The name of the subfolder is the topic name. For example, to create a global topic named bluetheme, you should create a folder named .. \ themes \ bluetheme.

    3. Add the appearance, style sheet, and image files that make up the topic to the new folder.

Create appearance
  1. Use the. Skin extension to create a new text file in the topic subfolders.

    A typical convention is to create a. Skin file for each control, such as button. skin or calendar. Skin. However, you can create more or less. Skin files based on your needs. Appearance files can contain multiple appearance definitions.

  2. In the. Skin file, add the general control definition (using declarative syntax), but only include the attributes to be set for the topic (property), not includingIDAttribute ). The control definition must containRunat = "server"Attribute.

    The following example shows the appearance of the default button control andButtonControl defines the color and Font:

    Copy code

    <Asp: button runat = "server" backcolor = "red" forecolor = "white" font-name = "Arial" font-size = "9px"/>

    Note:

    One convenient way to create the appearance is to add the control to the page and configure it to make it have the desired appearance. For example, you can add the calendar control to the page and set its date header, selected date, and other attributes. You can then copy the control definition from the page to the appearance file and then remove it.IDAttribute.

  3. Repeat steps 2 and 3 for the appearance of each control to be created.

    & Lt; table width = "100%" & gt; note

    only one default appearance can be defined for each control. You can use the skinid attribute in the control Declaration to create a naming appearance that can be applied to a specific control instance.

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.