使用ASP.NET和C#选择的DropDownList多值 [英] Select multiple value in DropDownList using ASP.NET and C#

查看:332
本文介绍了使用ASP.NET和C#选择的DropDownList多值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ASP.NET和C#选择的DropDownList多值。我试了一下,选择从下拉单值下降,但无法找到相当多的选择。

Select multiple value in DropDownList using ASP.NET and C#. I tried it to select single value from drop down but unable tofind multiple selection.

推荐答案

在这种情况下,你应该使用的ListBox 控件,而不是下拉列表和设置的SelectionMode 属性

In that case you should use ListBox control instead of dropdown and Set the SelectionMode property to Multiple

<asp:ListBox runat="server" SelectionMode="Multiple" >
  <asp:ListItem Text="test1"></asp:ListItem>
  <asp:ListItem Text="test2"></asp:ListItem>
  <asp:ListItem Text="test3"></asp:ListItem>
</asp:ListBox>

这篇关于使用ASP.NET和C#选择的DropDownList多值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆