以编程方式使用文本框的转发器

时间:2012-03-16 13:55:36

标签: c# asp.net repeater

我的目标是创建类似于列数和5行的表格。

我决定用asp.net控制中继器做到这一点。也许有更好的方式告诉我?

所以我需要的结果是在第一个列中会有多个列会有标题,在接下来的三行中它应该是文本框,其名称类似于标题的txt +名称,最后一行应该是复选框也有合适的名称。

所以我想要做的是定义一个列,因为它应该看起来然后以编程方式执行其余操作,或者只是绑定IList(标题的名称),并且应该创建其他列。

这可能吗?怎么做?

我现在拥有的是这样的东西:

<asp:Repeater ID="Repeater1" runat="server">
    <HeaderTemplate>
    <table border="1" width="100%">
        <tr>
            <td>%#Container.DataItem("value")%</td>
        </tr>
    </HeaderTemplate>
    <ItemTemplate>   
    <tr>
        <td><asp:TextBox ID="TextBox1" runat="server"/></td>
        <td><asp:TextBox ID="TextBox2" runat="server"/></td>
        <td><asp:TextBox ID="TextBox3" runat="server"/></td>
    </tr>

    </ItemTemplate>
    <FooterTemplate>

    </table>
    </FooterTemplate>
</asp:Repeater>

0 个答案:

没有答案
相关问题