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>