title: Set property "readonly" for @Html.TextBoxFor( ) dynamically based on fetched information from db
body: <p>I have multiple Textboxes defined using @Html.TextBoxFor(). Now I want some of them to be only "readonly" and some of them editable, based on the role of user accessing the page. </p>
  
  <p>I have tried using the following </p>
  
  <pre><code>@Html.TextBoxFor(f =&gt; f.VSSLabel, new { style = "height:19px", @Value = @ViewBag.fetchf.VSSLabel, @readonly="readonly" })
  </code></pre>
  
  <p>Is there any way that we can set @readonly="false" and it becomes editable, or any other approach so I switch it to "readonly" and editable based on the Value stored in a ViewBag variable coming from controller? </p>