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. ASP.NET ApplyStyleSheetSkin會針對頁面上所放置的宣告式控制項呼叫方法。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.

適用於