BaseValidator.AddAttributesToRender(HtmlTextWriter) 方法
定义
将需要为控件呈现的 HTML 特性和样式添加到指定的 HtmlTextWriter 对象。Adds the HTML attributes and styles that need to be rendered for the control to the specified HtmlTextWriter object.
protected:
override void AddAttributesToRender(System::Web::UI::HtmlTextWriter ^ writer);
protected override void AddAttributesToRender (System.Web.UI.HtmlTextWriter writer);
override this.AddAttributesToRender : System.Web.UI.HtmlTextWriter -> unit
Protected Overrides Sub AddAttributesToRender (writer As HtmlTextWriter)
参数
- writer
- HtmlTextWriter
表示在客户端上呈现 HTML 内容的输出流的 HtmlTextWriter。An HtmlTextWriter that represents the output stream to render HTML content on the client.
注解
AddAttributesToRender方法用于呈现控件的 HTML 标记中控件的特性。The AddAttributesToRender method is used to render the attributes of the control in the HTML tag for the control. 此方法通常由派生类中的控件开发人员重写,以将适当的特性和样式插入 HtmlTextWriter 控件的输出流中。This method is typically overridden by control developers in derived classes to insert the appropriate attributes and styles to the HtmlTextWriter output stream for a control.
继承者说明
重写 AddAttributesToRender(HtmlTextWriter) 方法时,请确保调用基类中的相应方法。When overriding the AddAttributesToRender(HtmlTextWriter) method, be sure to call the corresponding method in the base class. 否则,将不会呈现基类中包含的属性。Otherwise, the attributes contained in the base class will not be rendered.