WebControl.RenderContents(HtmlTextWriter) WebControl.RenderContents(HtmlTextWriter) WebControl.RenderContents(HtmlTextWriter) WebControl.RenderContents(HtmlTextWriter) Method

定義

將控制項的內容呈現在指定的寫入器。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 HtmlTextWriter 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.

適用於

另請參閱