Show a message when DataList is Empty

you can add on footer or header template
as show on code below :

<footertemplate> <asp:label id="lblNoData" runat="server" text="No Rows Found!" visible="<%#bool.Parse((DataListName.Items.Count==0).ToString())%>"></asp:label> </footertemplate>
<div style="overflow-x: scroll;"> <div style="width: 1324px;"> <footertemplate> <asp:label id="lblNoData" runat="server" text="No Rows Found!" visible="<%#bool.Parse((DataListName.Items.Count==0).ToString())%>"></asp:label> </footertemplate> </div> </div>
  1. <code>
  2. <div style="overflow-x: scroll;">
  3. <div style="width: 1324px;">
  4. <footertemplate>
  5. <asp:label id="lblNoData" runat="server" text="No Rows Found!" visible="<%#bool.Parse((DataListName.Items.Count==0).ToString())%>"></asp:label>
  6. </footertemplate>
  7. </div>
  8. </div>
  9. </code>
<code>
<div style="overflow-x: scroll;">
<div style="width: 1324px;">
<footertemplate>
      <asp:label id="lblNoData" runat="server" text="No Rows Found!"   visible="<%#bool.Parse((DataListName.Items.Count==0).ToString())%>"></asp:label>
   </footertemplate>
</div>
</div>
</code>

Popular posts from this blog

Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=xx.0.0.0, Culture=neutral, PublicKeyToken='xxx' or one of its dependencies.

C# Crop white space from around the image

The specified version string contains wildcards, which are not compatible with determinism.