当前位置: 代码迷 >> ASP.NET >> DropDownList有关问题`新手
  详细解决方案

DropDownList有关问题`新手

热度:2551   发布时间:2013-02-25 00:00:00.0
DropDownList问题````新手求助
我做一个搜索的自定义控件
要在DropDownList加两个选项(不需要进行数据绑定)
1.News
2.Product

然后news的value为1
product的value为2

请问应该怎么实现
谢谢``

------解决方案--------------------------------------------------------
在item属性中设置
------解决方案--------------------------------------------------------
<asp:DropDownList id= "DropDownList1 " runat= "server ">
<asp:ListItem Value= "1 "> news </asp:ListItem>
<asp:ListItem Value= "2 "> product </asp:ListItem>
</asp:DropDownList>
  相关解决方案