TableCell.RenderContents Method

This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Renders the TableCell contents to the specified HtmlTextWriter object.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

protected public:
virtual void RenderContents (
	HtmlTextWriter^ writer
) override
protected void RenderContents (
	HtmlTextWriter writer
)
protected internal override function RenderContents (
	writer : HtmlTextWriter
)
Not applicable.

Parameters

writer

The output stream that renders HTML content to the client.

If the TableCell control has child controls or is overridden in a derived class the base class's RenderContents method is called; otherwise, the value of the Text property is written to the HtmlTextWriter object.

The RenderContents method is used primarily by control developers extending the functionality of the TableCell control.

The following code example demonstrates how to override the RenderContents method in a custom TableCell control so that it custom text is inserted in the cell's contents.

No code example is currently available or this language may not be supported.
<%@ Page Language="VJ#" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.JSL.Controls" 
    Assembly="Samples.AspNet.JSL" %>
<!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 id="Head2" runat="server">
    <title>Custom TableCell - RenderContents - VJ# Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <h3>Custom TableCell - RenderContents - VJ# Example</h3>

    <asp:Table id="Table1" runat="server" CellPadding="3" CellSpacing="2">
      <asp:TableRow>
        <aspSample:CustomTableCellRenderContents Text="(0,0)" />
        <aspSample:CustomTableCellRenderContents Text="(0,1)" />
        <aspSample:CustomTableCellRenderContents Text="(0,2)" />
      </asp:TableRow>
      <asp:TableRow>
        <aspSample:CustomTableCellRenderContents Text="(1,0)" />
        <aspSample:CustomTableCellRenderContents Text="(1,1)" />
        <aspSample:CustomTableCellRenderContents Text="(1,2)" />
      </asp:TableRow>
    </asp:Table>

    </div>
    </form>
</body>
</html>

No code example is currently available or this language may not be supported.
package Samples.AspNet.JSL.Controls; 

public class CustomTableCellRenderContents
    extends System.Web.UI.WebControls.TableCell
{
    protected void RenderContents(System.Web.UI.HtmlTextWriter writer)
    {
        // Insert text into each TableCell.
        writer.Write("TableCell: ");

        // Call the base RenderContents method.
        super.RenderContents(writer);

    } 
} 

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: