title: asp.net mvc razor variables not correctly setting
body: <p>I am working on a page where i want to add class to a control based on a condition. I tried the below code but when I add dynamic class name in cshtml file it renders in a wrong way. Any suggestion?</p>
  
  <pre><code>   object TitleClass = (Model.Id != 0 &amp;&amp; Model.IsApproved) ?
          (object)new { @disabled = "disabled", @class = "headerBox" } : new{ @class = "headerBox"};
  
      &lt;div&gt;
          @Html.TextBoxFor(model =&gt; model.Title, new { @placeholder = "New Title", TitleClass })
          @Html.ValidationMessageFor(model =&gt; model.Title)
      &lt;/div&gt;
  </code></pre>
  
  <p>Rendered as </p>
  
  <pre><code>&lt;input name="Title" id="Title" type="text" placeholder="New Demand Title" value="cpx appr with orders" data-val-required="Enter Demand Title" data-val="true" titleclass="{ disabled = disabled, class = headerBox }"&gt;
  </code></pre>
  
  <p>Trying to make it render as </p>
  
  <pre><code>&lt;input name="Title" id="Title" type="text" placeholder="New Demand Title" value="cpx appr with orders" data-val-required="Enter Demand Title" data-val="true" disabled = disabled class = headerBox &gt;
  </code></pre>