asp.net mvc 3 areas - Disable dropdown list in MVC3 -
after I have dropdown: Controller: see How do I want to read or disable it?
on db = new TransFormezEntities ( ViewBag.fldCountry_ID = new selectList (db.tblCountries, "fldCountry_ID", "fldCountryName", stateDetails.fldCountry_ID)
& lt; Div class = "display-field" id = "fldCountry_ID" & gt; @ Html.DropDownList ("fldCountry_ID", "[selection]") & lt; / Div & gt;
Try the following pieces of code
For the disabled
for Html.DropDownList ("fldCountry_ID", ViewBag.fldCountry_ID, new {@disabled = "disabled"})
To read only
Html.DropDownList ("fldCountry_ID", ViewBag.fldCountry_ID, new {@ Readonly = "true"})
Comments
Post a Comment