title: Cleaner way of conditionally rendering part of a view in asp.net mvc2
body: <p>I have an inline style I want to apply to a partial view based on a parameter passed in to it via the ViewDataDictionary.</p>
  
  <p>My ascx look like this - </p>
  
  <pre><code>&lt;div &lt;% if ((bool)ViewData["Visible"] == false) { %&gt; style="display:none;" &lt;% } %&gt;&gt;
    ...
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there a cleaner way to do this?</p>
  
  <p><strong>Edit:</strong><br/>
  Just to clarify, this is a partial view which is already using strongly typed model. So, I needed a way of passing extra information to the partial view which I couldn't have in the model because it was actually being called for each entry of a collection container in the model for my containing view.</p>