title: Conditionally set Disabled and Checked attributes on HTML Elements
body: <p>I have a button and a checkbox in a template field in an asp GridView.  I want the disabled property of the button and the checked property of the checkbox to be set conditionally based on the Data Field Expiration.  If Expiration equals Permanent, then the button should be disabled and the checkbox checked.  If not, then the button is enabled and checkbox unchecked.  I've tried:</p>
  
  <pre><code>&lt;input type="button" id="expiration" disabled='&lt;%# (string)Eval("Expiration") == "Permanant" ? "disabled" : "enabled" %&gt;' value='&lt;%# Eval("Expiration") %&gt;'/&gt;
  &lt;input type="checkbox" id="permanent" checked= '&lt;%# (string)Eval("Expiration") == "Permanant" ? "checked" : "unchecked" %&gt;'/&gt;
  </code></pre>
  
  <p>But it seems that just having the disabled and checked attributes listed at all is causing all buttons to be disabled and all checkboxes checked.</p>