当前位置:编程学习 > C#/ASP.NET >>

ItemTemplate中添加tr td信息 求详解ItemTemplate

   <table width="100%" id="Table_SubCategory">
                                <asp:Repeater ID="repCategory" runat="server" OnItemDataBound="repCategory_ItemDataBound">
                                    <ItemTemplate>
                                        <tr>
                                            <td style="width: 100px; height:24px;" align="right">
                                                <asp:Label ID="labCategoryName" runat="server" Text='<%# Eval("CategoryName") %>'></asp:Label>
                                                <asp:HiddenField ID="hiddenCategoryID" runat="server" Value='<%# Eval("CategoryID") %>' />
                                                :
                                            </td>
                                            <td> 
                                                <asp:CheckBoxList ID="cbSubCategoryName" runat="server" RepeatDirection="Horizontal" RepeatColumns="8">
                                                </asp:CheckBoxList>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table> --------------------编程问答-------------------- ItemTemplate节中的部分就是会重复的部分 --------------------编程问答-------------------- !~据我的理解。。。
数据绑定的时候,是根据数据源里面的数据,一行一行的绑定的。每绑定一行时就触发OnItemDataBound事件,并绑定数据(就是tr td的内容。) --------------------编程问答-------------------- 没看明白楼主的意思。 --------------------编程问答-------------------- 同上,没说明白 --------------------编程问答-------------------- ItemTemplate是只有才Repeater中才用(tr td)? --------------------编程问答--------------------
引用 5 楼 pp8821 的回复:
ItemTemplate是只有才Repeater中才用(tr td)?

看情况而定。。 --------------------编程问答-------------------- 不懂你要实现什么效果。?
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,