Default text for empty Repeater control

Joaos answer can even be simplified. In the footer, do not set the visible-property of your default item to false, but use the following expression:

<FooterTemplate>
    <asp:Label ID="defaultItem" runat="server" 
        Visible="<%# YourRepeater.Items.Count == 0 %>" Text="No items found" />
</FooterTemplate>

This way, you can save the code behind.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)