网上看了很多一般都是重写repeater控件,不过发现一个超简单的方法,直接利用FooterTemplate 在里面加上  

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

  这样没有数据的话直接就显示"没有数据"了Repeater没有数据时显示空行

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-12-30
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2021-07-19
  • 2021-09-05
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案