Html.DropDownList - Disabled/Readonly

前端 未结 14 847
无人共我
无人共我 2020-12-01 08:51

What option do I need to set to make a drop down box readonly when using MVCs Html.DropDownList?

I\'ve tried things like....

Html.DropDownList(\"Type         


        
相关标签:
14条回答
  • 2020-12-01 09:37

    Or you can try something like this:

    Html.DropDownList("Types", Model.Types, new { @readonly = "true" })
    
    0 讨论(0)
  • 2020-12-01 09:37

    Html.DropDownList("Types", Model.Types, new { @disabled = "disabled" }) @Html.Hidden(Model.Types) and for save and recover the data, use a hidden control

    0 讨论(0)
提交回复
热议问题