======1st Way==========
<FooterTemplate>
<tr id="trEmpty" runat="server" visible="false">
<td colspan = "3" align = "center">
No records found.
</td>
</tr>
</FooterTemplate>
======Code Behind======
if (dt.Rows.Count == 0)
{
Control FooterTemplate = rptCustomers.Controls[rptCustomers.Controls.Count - 1].Controls[0];
FooterTemplate.FindControl("trEmpty").Visible = true;
}
======2nd Way========
<FooterTemplate>
<asp:Label ID="defaultItem" runat="server"
Visible='<%# YourRepeater.Items.Count == 0 %>' Text="No items found" />
</FooterTemplate>
======3rd Way========
<FooterTemplate>
<asp:Label ID="lblEmptyData" runat="server" Visible='<%# ((Repeater)Container.NamingContainer).Items.Count == 0 %>' Text="No items found" />
</FooterTemplate>
<FooterTemplate>
<tr id="trEmpty" runat="server" visible="false">
<td colspan = "3" align = "center">
No records found.
</td>
</tr>
</FooterTemplate>
======Code Behind======
if (dt.Rows.Count == 0)
{
Control FooterTemplate = rptCustomers.Controls[rptCustomers.Controls.Count - 1].Controls[0];
FooterTemplate.FindControl("trEmpty").Visible = true;
}
======2nd Way========
<FooterTemplate>
<asp:Label ID="defaultItem" runat="server"
Visible='<%# YourRepeater.Items.Count == 0 %>' Text="No items found" />
</FooterTemplate>
======3rd Way========
<FooterTemplate>
<asp:Label ID="lblEmptyData" runat="server" Visible='<%# ((Repeater)Container.NamingContainer).Items.Count == 0 %>' Text="No items found" />
</FooterTemplate>
No comments:
Post a Comment