需要在ASP.NET webform中包装表行和控件

Ron*_*rby 2 .net html c# asp.net xhtml

这是我的表:

  <table class="detailTable">
        <tr>
            <th>
                Event Title:
            </th>
            <td>
                <asp:Label ID="lblTitle" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <th>
                Date:
            </th>
            <td>
                <asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <th>
                Begin Time:
            </th>
            <td>
                <asp:TextBox ID="txtBeginTime" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <th>
                End Time:
            </th>
            <td>
                <asp:TextBox ID="txtEndTime" runat="server"></asp:TextBox>
            </td>
        </tr>
        <!-- I need to wrap these last two rows in some kind of server control -->
        <tr>
            <th>
                Duration:
            </th>
            <td>
                <asp:TextBox ID="txtHours" runat="server"></asp:TextBox>
                :
                <asp:TextBox ID="txtMins" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <th>
                Concurrency:
            </th>
            <td>
                <asp:TextBox ID="txtConcurrency" runat="server"></asp:TextBox>
            </td>
        </tr>
    </table>
Run Code Online (Sandbox Code Playgroud)

正如评论所述,我需要将最后两行包装在某种控件中,以便我可以在服务器端有条件地隐藏它们.

我知道我可以在行中添加runat ="server"并单独隐藏它们,但我不想那样做.我也不想隐藏它们的客户端.面板会很好,但它会渲染一个div,使得HTML无效.使用runat ="server"的TBODY也无效.Literal控件不能包含其他控件,所以它就出来了.

是否有一个我想念的控件可以实现这个目标?我基本上需要一个Panel控件,它只渲染它包含的东西,仅此而已.有没有办法更改面板控件,以便它不呈现包装div?

Ode*_*ded 6

怎么样一个占位符的控制?

这就是它的设计目标.