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>