I want to disable a textbox in the view. So I use following code:
<%= Html.TextBox(\"ID\", Model.ID, new { readonly=\"true\" })%>
or
Try
<%= Html.TextBox("ID", Model.ID, null, new { @readonly="true" })%>
instead of
<%= Html.TextBox("ID", Model.ID, new { @readonly="true" })%>
If you check the documentation, you can see that the third parameter is not htmlAttributes, as you probably expected.
You need to use the overload with four parameters.