Edit

Share via


WebPartChrome.RenderWebPart(HtmlTextWriter, WebPart) Method

Definition

Renders a complete WebPart control with all its sections.

public:
 virtual void RenderWebPart(System::Web::UI::HtmlTextWriter ^ writer, System::Web::UI::WebControls::WebParts::WebPart ^ webPart);
public virtual void RenderWebPart (System.Web.UI.HtmlTextWriter writer, System.Web.UI.WebControls.WebParts.WebPart webPart);
abstract member RenderWebPart : System.Web.UI.HtmlTextWriter * System.Web.UI.WebControls.WebParts.WebPart -> unit
override this.RenderWebPart : System.Web.UI.HtmlTextWriter * System.Web.UI.WebControls.WebParts.WebPart -> unit
Public Overridable Sub RenderWebPart (writer As HtmlTextWriter, webPart As WebPart)

Parameters

writer
HtmlTextWriter

The HtmlTextWriter that receives the webPart content.

webPart
WebPart

The control currently being rendered.

Exceptions

The control that webPart refers to is null.

Remarks

The RenderWebPart method renders the complete WebPart control, with header, contents, and footer. Overriding this method gives a developer complete programmatic control over rendering all aspects of webPart, and for that reason, overriding this method is quite complex. As with some other methods in the WebPartChrome class that developers can override, if you override this method, a common and useful approach is to call the base method first, take the WebPart control that is returned, and customize some of its properties, rather than handling the complete rendering yourself.

Applies to

See also