EditorPartChrome.RenderPartContents(HtmlTextWriter, EditorPart) 메서드

정의

머리글과 바닥글을 제외한 컨트롤의 EditorPart 기본 콘텐츠 영역을 렌더링합니다.

protected:
 virtual void RenderPartContents(System::Web::UI::HtmlTextWriter ^ writer, System::Web::UI::WebControls::WebParts::EditorPart ^ editorPart);
protected virtual void RenderPartContents(System.Web.UI.HtmlTextWriter writer, System.Web.UI.WebControls.WebParts.EditorPart editorPart);
abstract member RenderPartContents : System.Web.UI.HtmlTextWriter * System.Web.UI.WebControls.WebParts.EditorPart -> unit
override this.RenderPartContents : System.Web.UI.HtmlTextWriter * System.Web.UI.WebControls.WebParts.EditorPart -> unit
Protected Overridable Sub RenderPartContents (writer As HtmlTextWriter, editorPart As EditorPart)

매개 변수

writer
HtmlTextWriter

HtmlTextWriter 콘텐츠를 받는 대상입니다editorPart.

editorPart
EditorPart

현재 렌더링 중인 컨트롤입니다.

예제

다음 코드 예제에서는 편집기 부분에 텍스트를 추가 하는 메서드를 재정 RenderPartContents 의 하는 방법을 보여 줍니다. 이러한 컨트롤을 호스트하는 웹 페이지를 포함하여 예제를 실행하는 데 필요한 전체 코드는 클래스 개요의 예제 섹션을 EditorPartChrome 참조하세요.

protected override void RenderPartContents(HtmlTextWriter writer, EditorPart editorPart)
{
    writer.AddStyleAttribute("color", "red");
    writer.RenderBeginTag("p");
    writer.Write("Apply all changes");
    writer.RenderEndTag();
    editorPart.RenderControl(writer);
}
Protected Overrides Sub RenderPartContents(ByVal writer As System.Web.UI.HtmlTextWriter, ByVal editorPart As System.Web.UI.WebControls.WebParts.EditorPart)
    writer.AddStyleAttribute("color", "red")
    writer.RenderBeginTag("p")
    writer.Write("Apply all changes")
    writer.RenderEndTag()
    editorPart.RenderControl(writer)
End Sub

설명

RenderPartContents 메서드를 사용하면 머리글 및 바닥글의 렌더링을 기본 렌더링으로 유지하면서 본문 영역 editorPart의 렌더링을 재정의할 수 있습니다.

상속자 참고

필요에 따라 메서드를 재정의할 RenderPartContents(HtmlTextWriter, EditorPart) 수 있습니다. 이 경우 원하는 editorPart렌더링 사용자 지정을 수행한 다음 해당 RenderControl(HtmlTextWriter) 메서드를 호출할 수 있습니다.

적용 대상