title: Conditional display of table rows in a listview itemtemplate
body: <p>I seen similar questions asked various places, but haven't really found an answer to this that works for me yet. Basically, I have a ListView where I want to hide table rows if a particular value in the data binding if a particular condition is true (most often if the value of the item is null or empty string). I've tried making the tr runat="server" and setting the condition on the visible property, but this returns a runtime error "The server tag is not well formed." Here's what I'm trying to do:</p>
  
  <pre><code>&lt;asp:ListView runat="server" ID="FullInfoListView"&gt;
      &lt;LayoutTemplate&gt;
          &lt;table class="tablestripe" width="100%"&gt;
              &lt;asp:Placeholder runat="server" ID="itemPlaceholder" /&gt;
          &lt;/table&gt;
      &lt;/LayoutTemplate&gt;
      &lt;ItemTemplate&gt;
          &lt;tr valign="top" class="eventrow1"&gt;
              &lt;td colspan="2"&gt;
                  &lt;h3&gt;&lt;%# Eval("FirstName") Eval("LastName") %&gt;&lt;/h3&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr valign="top" runat="server" Visible="&lt;%# (bool)Eval("PhotoVis") %&gt;"&gt;
              &lt;td colspan="2"&gt;
                  &lt;img src="~/Userphoto/thumb/&lt;%# Eval("NetworkLogin") %&gt;.jpg" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:ListView&gt;
  </code></pre>