title: Hide an element in ASP.net based on an if inside a Repeater
body: <p>I know how to use a simple If statement wrapped in the &lt;%# tags to hide something, but I don't know how to do it in a repeater when I need to access Container.DataItem, as in I need the dataItem currently being 'repeated'</p>
  
  <p>eg</p>
  
  <pre><code>if (CurrentValidationMessage.Link != "")
  {
    show a hyperlink
  }
  </code></pre>
  
  <p>Markup:</p>
  
  <pre><code>&lt;asp:Repeater ID="repValidationResults" runat="server"&gt;
          &lt;HeaderTemplate&gt;
          &lt;/HeaderTemplate&gt;
          &lt;ItemTemplate&gt;
              &lt;a href='&lt;%# ((MttImportValidationMessage)Container.DataItem).EditLink  %&gt;'&gt; Link to erroneous Milestone &lt;/a&gt;
              &lt;%# ((MttImportValidationMessage)Container.DataItem).Message %&gt;
              &lt;br /&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
  </code></pre>