HtmlTextWriter.RegisterAttribute(String, HtmlTextWriterAttribute) HtmlTextWriter.RegisterAttribute(String, HtmlTextWriterAttribute) HtmlTextWriter.RegisterAttribute(String, HtmlTextWriterAttribute) HtmlTextWriter.RegisterAttribute(String, HtmlTextWriterAttribute) Method

定義

從原始程式檔登錄標記屬性 (不論是常值或動態產生),讓屬性可以適當地在提出要求的用戶端呈現。Registers markup attributes, whether literals or dynamically generated, from the source file so that they can be properly rendered to the requesting client.

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 String String String

字串,包含要登錄的標記屬性之名稱。A string containing the name of the markup attribute to register.

備註

在建立第一個RegisterAttribute HtmlTextWriter物件時,會透過呼叫方法來註冊 HTML 標籤語言的預先定義屬性。The predefined attributes of the HTML markup language are registered by calls to the RegisterAttribute method when the first HtmlTextWriter object is created. 動態屬性可以在其他時間使用RegisterAttribute方法進行註冊。Dynamic attributes can be registered by using the RegisterAttribute method at other times.

RegisterAttribute方法所使用的註冊表是, static因此屬性的註冊會套用至主HtmlTextWriter電腦上的所有物件。The registration table used by the RegisterAttribute method is static, so registration of attributes applies to all HtmlTextWriter objects on the host computer.

適用於

另請參閱