HtmlTextWriter.RegisterStyle(String, HtmlTextWriterStyle) 方法

定義

從原始程式檔登錄標記樣式屬性 (不論是常值或動態產生),讓屬性可以適當地在提出要求的用戶端呈現。

protected:
 static void RegisterStyle(System::String ^ name, System::Web::UI::HtmlTextWriterStyle key);
protected static void RegisterStyle (string name, System.Web.UI.HtmlTextWriterStyle key);
static member RegisterStyle : string * System.Web.UI.HtmlTextWriterStyle -> unit
Protected Shared Sub RegisterStyle (name As String, key As HtmlTextWriterStyle)

參數

name
String

從原始程式檔傳遞來的指定樣式名稱的字串。

key
HtmlTextWriterStyle

與指定樣式對應的 HtmlTextWriterStyle

備註

預先定義的級聯樣式表單 (CSS) HTML 標籤語言的屬性,會在建立第一個 HtmlTextWriter 物件時呼叫 RegisterStyle 方法來註冊。 動態樣式屬性可以在其他時間使用 RegisterStyle 方法來註冊。

方法所使用的 RegisterStyle 註冊資料表是 static ,因此屬性的註冊會套用至主機電腦上的所有 HtmlTextWriter 物件。

適用於

另請參閱