title: Can I use an IF statement in a GridView ItemTemplate?
body: <p>I have a simple gridview ItemTemplate that looks like this:</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="User"&gt;
     &lt;ItemTemplate&gt;
        &lt;a href="mailto:&lt;%# Eval("Email") %&gt;"&gt;&lt;%# Eval("Name") %&gt;&lt;/a&gt;
     &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>However, not all of the users on this list have emails stored in the system, which means Eval("Email") sometimes returns blank.  When this happens, I'd rather not have a link on the field, since the mailto won't work without an email address.</p>
  
  <p>How can I do this?  I was hoping I could use an IF statement in the presentation code kind of like how classic ASP used to work.  If not, I suppose I could create a property on my datasource that includes the entire HREF html...</p>