title: Using Eval Boolean to set a style for an asp.net control
body: <p>I have an <code>asp:ListView</code> control containing a bunch of images set up like this:</p>
  
  <pre><code>&lt;asp:ListView ID="lvSliderPhotos" runat="server"&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:Image ID="imgSliderPhoto" runat="server"
              ImageUrl='&lt;%# Eval("ThumbnailPath") %&gt;' /&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>For my DB table containing these I have a field called <code>IsPublic</code> which stores a boolean.  How can I apply a style to the <code>asp:Image</code> control if the value is false?</p>
  
  <p>I basically want something like this:</p>
  
  <pre><code>&lt;asp:Image ID="imgSliderPhoto" runat="server"
      ImageUrl='&lt;%# Eval("ThumbnailPath") %&gt;'
      Style='&lt;if (!Eval("IsPublic") { set a style property }&gt;' /&gt;
  </code></pre>
  
  <p>Any idea how this can be accomplished?</p>