HtmlTable.RenderEndTag(HtmlTextWriter) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨트롤의 끝 태그를 렌더링합니다 HtmlTable .
protected:
override void RenderEndTag(System::Web::UI::HtmlTextWriter ^ writer);
protected override void RenderEndTag(System.Web.UI.HtmlTextWriter writer);
override this.RenderEndTag : System.Web.UI.HtmlTextWriter -> unit
Protected Overrides Sub RenderEndTag (writer As HtmlTextWriter)
매개 변수
- writer
- HtmlTextWriter
HtmlTextWriter 렌더링된 콘텐츠를 받는 대상입니다.
예제
다음 코드 예제에서는 항상 사용자 지정 RenderEndTag 서버 컨트롤에 HtmlTable 끝 태그 및 새 줄을 작성하도록 메서드를 재정의하는 방법을 보여 줍니다.
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls" Assembly="Samples.AspNet.CS" %>
<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Custom HtmlTable - RenderEndTag Example</title>
</head>
<body>
<form id="Form1"
method="post"
runat="server">
<h3>Custom HtmlTable - RenderEndTag Example</h3>
<aspSample:CustomHtmlTableRenderEndTag
id="HtmlTable1"
name="HtmlTable1"
runat="server"
border="1"
cellSpacing="0"
cellPadding="5">
<tr>
<td>1,1</td>
<td>1,2</td>
<td>1,3</td>
</tr>
<tr>
<td>2,1</td>
<td>2,2</td>
<td>2,3</td>
</tr>
<tr>
<td>3,1</td>
<td>3,2</td>
<td>3,3</td>
</tr>
</aspSample:CustomHtmlTableRenderEndTag>
</form>
</body>
</html>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls" Assembly="Samples.AspNet.VB" %>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Custom HtmlTable - RenderEndTag Example</title>
</head>
<body>
<form id="Form1"
method="post"
runat="server">
<h3>Custom HtmlTable - RenderEndTag Example</h3>
<aspSample:CustomHtmlTableRenderEndTag
id="HtmlTable1"
name="HtmlTable1"
runat="server"
border="1"
cellSpacing="0"
cellPadding="5">
<tr>
<td>1,1</td>
<td>1,2</td>
<td>1,3</td>
</tr>
<tr>
<td>2,1</td>
<td>2,2</td>
<td>2,3</td>
</tr>
<tr>
<td>3,1</td>
<td>3,2</td>
<td>3,3</td>
</tr>
</aspSample:CustomHtmlTableRenderEndTag>
</form>
</body>
</html>
using System.Web;
using System.Security.Permissions;
namespace Samples.AspNet.CS.Controls
{
[AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class CustomHtmlTableRenderEndTag : System.Web.UI.HtmlControls.HtmlTable
{
protected override void RenderEndTag(System.Web.UI.HtmlTextWriter writer)
{
// Write out the current TagName.
writer.WriteEndTag(this.TagName);
// Write out a new line.
writer.WriteLine();
}
}
}
Imports System.Web
Imports System.Security.Permissions
Namespace Samples.AspNet.VB.Controls
<AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class CustomHtmlTableRenderEndTag
Inherits System.Web.UI.HtmlControls.HtmlTable
Protected Overrides Sub RenderEndTag(ByVal writer As System.Web.UI.HtmlTextWriter)
' Write out the current TagName.
writer.WriteEndTag(Me.TagName)
' Write out a new line.
writer.WriteLine()
End Sub
End Class
End Namespace
설명
이 메서드는 RenderEndTag 기본 클래스의 HtmlContainerControl.RenderEndTag 메서드를 호출한 후 추가 서식을 제공합니다. 추가 서식을 사용하면 닫 HtmlTable 는 태그 뒤에 줄 반환을 <table> 삽입하여 컨트롤의 렌더링된 HTML을 더 쉽게 읽을 수 있습니다.
이 RenderChildren 메서드는 주로 컨트롤의 기능을 확장 하는 컨트롤 개발자에 HtmlTable 의해 사용 됩니다.