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.

適用於