标签:select textfield str pdo amp tab down sel insert
前台
<asp:DropDownList runat="server" ID="aa"></asp:DropDownList>
后台
public void Bind1()
{
aa.DataSource = s1.select("SELECT ID,name FROM 表 ");
aa.DataTextField = "name";
aa.DataValueField = "ID";
aa.DataBind();
aa.Items.Insert(0, new ListItem("--请选择--", "0"));
}
获取值
if (aa.SelectedValue != "" && aa.SelectedValue != "0")
{
string a= aa.SelectedValue;
}
标签:select textfield str pdo amp tab down sel insert
原文地址:https://www.cnblogs.com/xqfk/p/11077661.html