tags:

views:

592

answers:

2

I would like to create (in code) tree of controls that would render as a table with several TBODY tags, i.e.:

<TBODY>
    <TR>
        <TD></TD>
    </TR>
    <TR>
        <TD></TD>
    </TR>
</TBODY>

I tried both Table and HtmlTable controls but had no success. Any clues?

+2  A: 

How are you generating your data? You could use a templated control like a Repeater or ListView as that gives you full control of the HTML you're generating.

If you're wanting to create the controls purely in C# you can use the HtmlGenericControl (http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlgenericcontrol.aspx), you'll need to provide a tag type in the constructor.

Slace
A: 

I am writing a class that implements IBindableTemplate, so all of the rendering has to be done in code. I will give the HtmlGenericControl a try. Thanks!

Marcin Hoppe