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 );
}