DropDownList添加第一个选项
2018-05-08 本文已影响7人
青木川_
public void InitDrop()
{
droptype.DataSource = sqlhelper.publicFun("select * from tb_bigclass where sonType_Id=48");
droptype.DataTextField = "bigclass_Name";
droptype.DataValueField = "bigclass_Id";
droptype.DataBind();
droptype.Items.Insert(0, new ListItem("选择类型", ""));
}
页面代码:
<asp:DropDownList ID="droptype" runat="server" class="col-xs-10 col-sm-5">
</asp:DropDownList>