C# dropdownlist 拿值问题

2025-01-03 20:04:35
推荐回答(3个)
回答1:

那说明你ddl绑定数据出问题了;ddl绑定方法如下
ddlItems.DataSource = voe.SelectItems();
ddlItems.DataTextField = "title";
ddlItems.DataValueField = "id";
ddlItems.DataBind();

回答2:

dropdownlist.selectedvalue

回答3:

this.DropDownList1.SelectedValue
这样不就行了么