how can i disable the list box
Html.ListBox("Organization", Model.OrgListbox as MultiSelectList)
how can i disable the list box
Html.ListBox("Organization", Model.OrgListbox as MultiSelectList)
You use the htmlAttributes parameter:
Html.ListBox("Organization", Model.OrgListbox as MultiSelectList, new { disabled = "disabled" })
If you want to add the disabled attribute to the HTML then you would do this:
Html.ListBox("Organization", Model.OrgListbox as MultiSelectList, new { disabled = "disabled" })
This calls the overload of Html.ListBox where you can specify htmlAttributes that are added to the rendered HTML.
Alternatively you could use jQuery, doing something like this:
$("#controlId).attr("disabled","disabled");