如何将下拉属性添加到C#中的下拉列表中 [英] How do I add dropped down attribute to a dropdownlist in C#
本文介绍了如何将下拉属性添加到C#中的下拉列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在客户端有这个下拉列表。
I have this Drop-down list at client side.
<asp:DropDownList ID="DropDownList1" runat="server"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
和服务器端。
and on the server side.
String mdbCon = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\InspectionR\\Database1.mdb";
DataSet ds1 = new DataSet();
string db = "SELECT MODEL_NAME FROM MODEL_LIST";
using (OleDbConnection cn = new OleDbConnection(mdbCon))
{
using (OleDbDataAdapter da = new OleDbDataAdapter(db, cn))
{
da.Fill(ds1, "Model");
}
}
DropDownList1.DataTextField = "MODEL_NAME";
DropDownList1.DataValueField = "MODEL_NAME";
DropDownList1.DataSource = ds1;
DropDownList1.DataBind();
// DropDownList1.Attributes.Add("multiple", "multiple");
我想在VB.net中使用dropdown = true属性
我尝试了多个属性,但它只会扩大但不会下降。
谢谢
我尝试过:
I want the feature like droppeddown = true property in VB.net
I tried "multiple" attribute, but it will only expand but won't drop down.
Thank you
What I have tried:
DropDownList1.Attributes.Add("multiple", "multiple");
推荐答案
查看此帖子
javascript - 是否可以使用JS以编程方式打开HTML选择? [ ^ ]
尝试向DropDownLis添加属性倍数在加载页面后使用DropDownList1 ClientId和jQuery
Try adding attribure multiple to DropDownList using DropDownList1 ClientId and jQuery after loading the page
这篇关于如何将下拉属性添加到C#中的下拉列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文