HtmlTextWriter.RegisterTag(String, HtmlTextWriterTag) HtmlTextWriter.RegisterTag(String, HtmlTextWriterTag) HtmlTextWriter.RegisterTag(String, HtmlTextWriterTag) HtmlTextWriter.RegisterTag(String, HtmlTextWriterTag) Method

定義

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

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

參數

name
String String String String

包含 HTML 標記的字串。A string that contains the HTML tag.

key
HtmlTextWriterTag HtmlTextWriterTag HtmlTextWriterTag HtmlTextWriterTag

HtmlTextWriterTag,指定要呈現哪一個項目。An HtmlTextWriterTag that specifies which element to render.

備註

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

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

適用於

另請參閱