Main topics and patterns of ASP. Net 2.0 learning frameworks

Source: Internet
Author: User

ASP. net 2.0 main topic file (*. skin) are all placed under the App_Themes object, after the server-side controls are configured on the plane, copy the ID-removing replace into the skin file to create the master topic file. If the skin file does not have a SkinId, this method will be used for all controls on the interface, and vice versa, only for controls with this SkinId. In addition, if SkinId is set on a server control on the interface, the style of this control is still available in the main topic, but the corresponding SkinId is not defined, on the interface, the control only displays the same style as the default one, instead of using the same style in the main topic.

Both Theme and StyleSheetTheme can be used on the primary topic file. The difference is that Theme> CSS> StyleSheetTheme in the control.

If the external CSS file is referenced on the CSS file, the control itself can set the CSS class in CssClass adequacy, or add the CssClass adequacy in the style of the control in the Skin file, the SkinId is used in the related controls. The results of these two methods are the same.

Example:
<Asp: Label ID = "Label1" CssClass = "LableStyle" runat = "server" Text = "Label"> </asp: Label>
Or
<Asp: Label ID = "Label1" SkinID = "LableSkin" runat = "server" Text = "Label"> </asp: Label>
In the skin file, replace
<Asp: Label SkinId = "LableSkin" cssClass = "LableStyle" runat = "server" Text = "Label"> </asp: Label>

 

When using the OnPreInit method, you must add the primary topic to the OnPreInit method.

Protected override void OnPreInit (EventArgs e)
{
This. Theme = "DefSkin ";

Base. OnPreInit (e );
}

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.