asp.net mvc 3 areas - Disable dropdown list in MVC3 -


"itemprop =" text ">

after I have dropdown: Controller:

  on db = new TransFormezEntities ( ViewBag.fldCountry_ID = new selectList (db.tblCountries, "fldCountry_ID", "fldCountryName", stateDetails.fldCountry_ID)  

see

country
  & lt; Div class = "display-field" id = "fldCountry_ID" & gt; @ Html.DropDownList ("fldCountry_ID", "[selection]") & lt; / Div & gt;  

How do I want to read or disable it?

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

Popular posts from this blog

python - rpy2 import is not working -

javascript - How to get MySQL query result returned using $.ajax -

javascript - How to use the code plugin with popcornjs -