title: Proper way to handle a conditional PlaceHolder in ASP.net
body: <p>I'm still getting used to the way ASP.net WebForms handles things but this one is still puzzling to me.  In some instances I have markup that should be displayed if an object is null and that markup should contain values from that object.</p>
  
  <p><strong>A very simple example:</strong></p>
  
  <pre><code>&lt;asp:PlaceHolder runat="server" Visible='&lt;%# myObject != null %&gt;'&gt;
      &lt;span&gt;&lt;%= myObject.Property %&gt;&lt;/span&gt;
  &lt;/asp:PlaceHolder&gt;
  </code></pre>
  
  <p>The problem is that it seem ASP.net parses the contents of the placeholder regardless of the visibility.  The above code ends with the error:</p>
  
  <p><em><code>Object reference not set to an instance of an object.</code></em></p>
  
  <p>Is there a way to handle this without having a million <code>&lt;asp:Literal&gt;</code>'s?</p>