I'm new to writing custom ASP.NET server controls, and I'm encountering the following issue:
I have a control that inherits from System.Web.UI.HtmlControls.HtmlGenericControl
. I override the control's Render method, use the HtmlTextWriter
to emit some custom HTML (basically a TD
tag with some custom attributes), and then call the case class' Render method.
Using the control:
<dc:Header id="header1" runat="Server" DataColumn="MemberNumber" Width="30%">Member Number</dc:Header >
The problem is that when I view my rendered HTML, the server tag is emitted to the client as well (right after the TD
tag):
<dc:Header id="ctl00_ContentPlaceHolder_testData1_testData1_header1">Member Number</dc:Header>
How do I prevent this from happening?