WebControl.RenderContents(HtmlTextWriter) 方法

定義

將控制項的內容呈現在指定的寫入器。Renders the contents of the control to the specified writer. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

protected:
 virtual void RenderContents(System::Web::UI::HtmlTextWriter ^ writer);
protected public:
 virtual void RenderContents(System::Web::UI::HtmlTextWriter ^ writer);
protected 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 Overridable Sub RenderContents (writer As HtmlTextWriter)
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.

適用於

另請參閱