Repeart控件使用

对于刚刚接触到repearter控件,了解不深,现做个记录方便以后的查看

 
  
 1     <asp:Repeater ID="rpt_OrderList" runat="server" OnItemDataBound="rpt_OrderList_ItemDataBound">
 2                         <HeaderTemplate>
 3                             <table>
 4                                 <thead>
 5                                     <tr>
 6                                         <th style="width: 50px">序号
 7                                         </th>
 8                                         <th >变更事项
 9                                         </th>
10                                         <th>变更日期
11                                         </th> 
12                                     </tr>
13                                 </thead>
14                                 <tbody>
15                         </HeaderTemplate>
16                         <ItemTemplate>
17                             <tr>
18                                 <td>
19                                     <%#PageIndex * PageSize + Container.ItemIndex+1 %>
20                                 </td>     
21                                 <td class="nowarp" title="<%#Eval("BGSX")%>">
22                                      <asp:Label ID="lbBGSX" runat="server"></asp:Label>  
23                                 </td>
24                                <td>
25                                    <%#string.Format("{0:yyyy年MM月dd日}", DateTime.Parse(Eval("BGRQ").ToString()))%>
26                                </td>
27                             </tr>
28                         </ItemTemplate>
29                         <FooterTemplate>
30                             </tbody>
31                             <tfoot>
32                                 <tr>
33                                     <td colspan="3">
34                                         <span id="noneData">暂无数据 </span>
35                                         <div id="pager">
36                                         </div>
37                                     </td>
38                                 </tr>
39                             </tfoot>
40                             </table>
41                         </FooterTemplate>
42                     </asp:Repeater>
要使用Repeater控件显示数据,必须创建ItemTemplate。

使用ItemTemplate显示数据 

例如:
 1   <ItemTemplate>
 2                             <tr>
 3                                 <td>
 4                                     <%#PageIndex * PageSize + Container.ItemIndex+1 %>
 5                                 </td>     
 6                                 <td class="nowarp" title="<%#Eval("BGSX")%>">
 7                                      <asp:Label ID="lbBGSX" runat="server"></asp:Label>  
 8                                 </td>
 9                                <td>
10                                    <%#string.Format("{0:yyyy年MM月dd日}", DateTime.Parse(Eval("BGRQ").ToString()))%>
11                                </td>
12                             </tr>
13   </ItemTemplate>

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/CbfBlogs/p/6133845.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值