如何使用C#一次填充ASP.NET中的两个下拉列表 [英] How to fill at a time two dropdown lists in ASP.NET using C#
本文介绍了如何使用C#一次填充ASP.NET中的两个下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp.net中使用c填写两个下拉列表#
我尝试过:
i我试过如何使用c#
解决方案
BindDDL来填充asp.net中的dropdownlist ()
{
DropDownList1.DataSource = ds
DropDownList1.DataTextField = emailid
DropDownList1.DataValueField = userid
DropDownList1。 DataBind()
DropDownList1.Items.Insert( 0 ,New ListItem( 选择, - 1))
DropDownList2.DataSource = ds
DropDownList2.DataTextField = emailid
DropDownList2.DataValueField = userid
DropDownList2.DataBind()
DropDownList2.Items.Insert( 0 ,New ListItem( 选择, - 1))
}
How to fill at a time two dropdown lists in asp.net using c#
What I have tried:
i am tried how to fill dropdownlist in asp.net using c#
解决方案
BindDDL() { DropDownList1.DataSource = ds DropDownList1.DataTextField = "emailid" DropDownList1.DataValueField = "userid" DropDownList1.DataBind() DropDownList1.Items.Insert(0, New ListItem("select", "-1")) DropDownList2.DataSource = ds DropDownList2.DataTextField = "emailid" DropDownList2.DataValueField = "userid" DropDownList2.DataBind() DropDownList2.Items.Insert(0, New ListItem("select", "-1")) }
这篇关于如何使用C#一次填充ASP.NET中的两个下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文