Control.ApplyStyleSheetSkin(Page) Control.ApplyStyleSheetSkin(Page) Control.ApplyStyleSheetSkin(Page) Method

定义

将页样式表中定义的样式属性应用到控件。Applies the style properties defined in the page style sheet to the control.

public:
 virtual void ApplyStyleSheetSkin(System::Web::UI::Page ^ page);
public virtual void ApplyStyleSheetSkin (System.Web.UI.Page page);
abstract member ApplyStyleSheetSkin : System.Web.UI.Page -> unit
override this.ApplyStyleSheetSkin : System.Web.UI.Page -> unit

参数

page
Page Page Page

包含控件的 PageThe Page containing the control.

异常

已经应用了样式表。The style sheet is already applied.

注解

ApplyStyleSheetSkin方法基于在主题目录中定义的外观属性来设置控件的样式属性。The ApplyStyleSheetSkin method sets style properties on the control based on skin properties defined in a theme directory. 应用的外观是控件的默认外观或SkinID属性中指定的外观。The skin applied is either the default skin for the control or the skin specified in the SkinID property. ApplyStyleSheetSkin方法由 ASP.NET 调用,用于放置在页面上的声明性控件。The ApplyStyleSheetSkin method is called by ASP.NET for declarative controls placed on a page. 您必须在运行ApplyStyleSheetSkin时以编程方式在运行时对创建的任何控件调用方法,才能将样式表的外观应用于控件。You must call the ApplyStyleSheetSkin method on any controls created programmatically at run time for style sheet skins to apply to the control. 主题外观会自动应用。Theme skins are applied automatically. 有关主题和级联样式表之间的差异的详细信息,请参阅ASP.NET 主题和外观For more information on the difference between themes and cascading style sheets, see ASP.NET Themes and Skins.

适用于