Strongly-typed binding to a DropDownListFor?

前端 未结 4 1379
盖世英雄少女心
盖世英雄少女心 2021-01-05 03:34

Normally I would bind data to a DropDownListFor with a SelectList:

@Html.DropDownListFor(model => model.CustomerId, new SelectLi         


        
4条回答
  •  抹茶落季
    2021-01-05 03:59

    There doesn't appear to be an overloaded constructor to allow for this. But there's no harm in manually specifying the DataTextField and DataValueField as a string is there?

提交回复
热议问题