HtmlTextWriter.RegisterAttribute(String, HtmlTextWriterAttribute) 方法

定義

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

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

參數

name
String

字串,包含要登錄的標記屬性之名稱。

key
HtmlTextWriterAttribute

與屬性名稱對應的 HtmlTextWriterAttribute

備註

建立第一個 HtmlTextWriter 物件時,會呼叫 RegisterAttribute 方法來註冊 HTML 標籤語言的預先定義屬性。 動態屬性可以透過在其他時間使用 RegisterAttribute 方法來註冊。

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

適用於

另請參閱