title: How to have a conditional checked, disabled, ... with the html helper?
body: <p>For a view, I've to generate some checkbox.</p>
  
  <p>I've one collection of items:</p>
  
  <pre><code>public class ItemSelection
      {
          public int Id { get; set; }
          public String Name { get; set; }
          public Boolean IsSelected { get; set; }
          public Boolean IsActive { get; set; }
      }
  </code></pre>
  
  <p>and in the view, I'm iterating on this</p>
  
  <pre><code>@foreach(ItemSelection item in Model.Items){
     Html.CheckBoxFor(m=&gt;item.IsSelected)//HERE I WOULD LIKE TO HAVE DISABLED properties if I've a IsActive=falsel
     Html.HiddenFor(m=&gt;item.Id)
  }
  </code></pre>
  
  <p>Now I see that I can do a "if" in which I create a different HtmlAttribute array, depending of this property, but is there a way to create only one array</p>
  
  <pre><code>new {disabled=item.IsActive?"ONE_SPECIAL_VALUE_HERE":"disabled"}
  </code></pre>
  
  <p>I tried to put <code>false</code>, or some other things, nothing worked.</p>