C# 需要在ASP.NET Web窗体中包装表行和控件

C# 需要在ASP.NET Web窗体中包装表行和控件,c#,.net,asp.net,html,xhtml,C#,.net,Asp.net,Html,Xhtml,这是我的桌子: <table class="detailTable"> <tr> <th> Event Title: </th> <td> <asp:Label ID="lblTitle" runat="server"></asp:Label>

这是我的桌子:

  <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>

活动名称:
日期:
开始时间:
结束时间:
持续时间:
:
并发性:
正如注释所述,我需要将最后两行包装在某种控件中,以便有条件地在服务器端隐藏它们

我知道我可以将runat=“server”添加到行中并单独隐藏它们,但我不想这样做。我也不想在客户端隐藏它们。一个面板会很好,但它会呈现一个div,这使得HTML无效。带有runat=“server”的TBODY也无效。文字控件不能包含其他控件,因此它已过期

是否有一个我缺少的控件可以实现这一点?我基本上需要一个面板控件,只渲染它包含的内容,什么也不渲染。是否有方法更改面板控件,使其不呈现换行div?

控件如何


这就是它的设计目的。

为什么不将runat=“server”添加到行中?这似乎是一个完全可以接受的解决方案,因为你还有其他限制。如果有很多行,我不想这样做。这正是我需要的。我以前从未用过它。