语言

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 。

注解

创建第一个RegisterAttribute对象时,HTML 标记语言的预定义属性通过调用HtmlTextWriter方法进行注册。 可以在其他时间使用 RegisterAttribute 该方法注册动态属性。

该方法使用的 RegisterAttribute 注册表是 static,因此属性注册适用于主计算机上的所有 HtmlTextWriter 对象。

适用于

另请参阅