在UI上垂直绑定转发器内容

时间:2016-11-11 09:55:40

标签: c# asp.net repeater

我有asp.net转发器(数据控制),目前它在这样的用户界面enter image description here

转发器的id是行,我想用相同的外观垂直绑定它,我的当前转发器代码如下

<table><tr><td>
<asp:Repeater ID="rptOptions" runat="server" OnItemDataBound="rptOptions_ItemDataBound">
 <ItemTemplate>
  <asp:TextBox ID="txtLetter" runat="server" MaxLength="40" BorderColor="Black" BorderStyle="Solid" onkeydown="navigate(event);" BorderWidth="1px" Height="25px" Style="margin-left: 110px; display: inline; margin-top: 16px;" Visible="true" Width="200px" Enabled="false" oncopy="return(false);" oncut="return(false);" onpaste="return(false);" autocomplete="off" AutoCompleteType="None" >
  </asp:TextBox>
 </ItemTemplate>
</asp:Repeater>
</td></tr></table>

1 个答案:

答案 0 :(得分:0)

<asp:Repeater ID="rptOptions" runat="server">
            <HeaderTemplate>
                <table style="width: 50%">
                    <tr>
                        <td>
            </HeaderTemplate>
            <ItemTemplate>
                <asp:TextBox ID="txtLetter" runat="server" MaxLength="40" BorderColor="Black" BorderStyle="Solid"
                    onkeydown="navigate(event);" BorderWidth="1px" Height="25px" Style="margin-left: 110px;
                    display: inline; margin-top: 16px;" Visible="true" Width="200px" Enabled="false"
                    oncopy="return(false);" oncut="return(false);" onpaste="return(false);" autocomplete="off"
                    AutoCompleteType="None">
                </asp:TextBox>
            </ItemTemplate>
            <FooterTemplate>
                </td> </tr> </table>
            </FooterTemplate>
        </asp:Repeater>