专注于高品质PHP技术等信息服务于一体 [STIEMAP] [RSS]

百度提供的广告:
c#
当前位置:首页 > 技术文档 > c# >  > 
.net Repeater如何显示没有数据当没有数据绑定时

    Repeater 具体良好的定制性,可以自定义显示效果。实际应用比较多,可是少一个功能,就是在没有 数据源的情况下,没有显示“暂无数据”的方法,需要自己来写。

<asp:Repeater ID="ContentRepList" runat="server">        
    <ItemTemplate>          
    </ItemTemplate>       
    <FooterTemplate>          
    <asp:Label ID="lblEmpty"     
        Text="没有数据" runat="server"     
        Visible='<%#bool.Parse((RptrA.Items.Count==0).ToString())%>'>       
    </asp:Label>       
    </FooterTemplate>           
    </asp:Repeater>