How to add an initial “select” value to a DropDownList

前端 未结 3 697
鱼传尺愫
鱼传尺愫 2021-01-05 02:57

If I use a DropDownList:

 

        
3条回答
  •  死守一世寂寞
    2021-01-05 03:39

    
           
    
    

    You could now bind your DropDown in the code behind as usual to the datasource and this data source doesn't need to contain a default value item:

    IEnumerable model = ...
    DropDownListSubContractors.DataSource = model;
    DropDownListSubContractors.DataBind();
    

提交回复
热议问题