asp.net mvc How to add placeholder for html.dropdownlist

后端 未结 10 599
眼角桃花
眼角桃花 2021-01-01 23:13

I\'m using asp.net mvc 3.

I have this dropdownlist of countries and I want to add a placeholder for it. Here\'s my code:

@Html.DropDownList(\"country         


        
10条回答
  •  庸人自扰
    2021-01-01 23:57

    Maybe if you want, try this:

    @Html.DropDownList("country",null,"-SELECT-",new { @class="chzn-select",@style="width:160px;" })
    

提交回复
热议问题