No results

Jul 25, 2011 at 7:15 AM

if there are no results, the headers still render. How can I present a "No Results" message instead when there are no results?

Aug 9, 2011 at 11:37 AM

Add the following template to your XSLT. Remove the <table> and </table> tags from the "dvt_1" template.

<xsl:template match="/" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:XsltExtension="urn:xsltExtension-XsltExtension">
  <table border="0" width="100%" cellpadding="4" cellspacing="2" id="ResultsTable" align="right">
   <xsl:choose>
    <xsl:when test="/All_Results/NumberOfResults &gt; 0">
     <xsl:call-template name="dvt_1"/>
    </xsl:when>
    <xsl:otherwise>
     <tr>
      <td>No results found.</td>
     </tr>
    </xsl:otherwise>
   </xsl:choose>
  </table>
 </xsl:template>