Html.DropDownList - Disabled/Readonly
Try this
Html.DropDownList("Types", Model.Types, new { @disabled = "disabled" })
Regarding the catch 22:
If we use @disabled
, the field is not sent to the action (Mamoud)
And if we use @readonly
, the drop down bug still lets you change the value
Workaround: use @disabled
, and add the field hidden after the drop down:
@Html.HiddenFor(model => model.xxxxxxxx)
Then it is truly disabled, and sent to the to the action too.