Html.DropDownList - Disabled/Readonly

前端 未结 14 905
无人共我
无人共我 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:16

    I've create this answer after referring above all comments & answers. This will resolve the dropdown population error even it get disabled.

    Step 01

    Html.DropDownList("Types", Model.Types, new {@readonly="readonly"})

    Step 02 This is css pointerevent remove code.

    Then you can have expected results

    Tested & Proven

提交回复
热议问题