WebControl.RenderContents(HtmlTextWriter) 方法

定义

将控件的内容呈现到指定的编写器中。Renders the contents of the control to the specified writer. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

protected public:
 virtual void RenderContents(System::Web::UI::HtmlTextWriter ^ writer);
protected internal virtual void RenderContents (System.Web.UI.HtmlTextWriter writer);
abstract member RenderContents : System.Web.UI.HtmlTextWriter -> unit
override this.RenderContents : System.Web.UI.HtmlTextWriter -> unit
Protected Friend Overridable Sub RenderContents (writer As HtmlTextWriter)

参数

writer
HtmlTextWriter

HtmlTextWriter,表示要在客户端呈现 HTML 内容的输出流。A HtmlTextWriter that represents the output stream to render HTML content on the client.

注解

重写RenderContents方法以呈现开始标记和结束标记之间的控件内容。Override the RenderContents method to render the contents of the control between the begin and end tags. 此方法的默认实现将呈现任何子控件。The default implementation of this method renders any child controls.

如果控件具有子控件,则必须调用基RenderContents方法,或RenderChildren在希望子控件呈现到文本编写器的位置调用。If your control has child controls, you must either call the base RenderContents method or call the RenderChildren at the point where you want the child controls to be rendered to the text writer.

适用于

另请参阅