如何使用ASP.NET在HTML中使用下拉选项? [英] How to use dropdown option in HTML using ASP.NET?

查看:44
本文介绍了如何使用ASP.NET在HTML中使用下拉选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有下拉显示名称..

当我点击下拉列表并输入名称的起始字母时,dropdownlist必须只显示名称才能开始用字母输入我的信息..

例如..点击下拉列表并输入'm'字样,以'm'开头的名字列表将显示。

有谁知道怎么做?



我尝试过:



< ASP:的TableRow> 
将ASP:TableCell的>
将ASP:标签ID = lbl_approve RUNAT = 服务器 文本= 批准 >< / ASP:标签>< / ASP:TableCell的>< ASP:TableCell的>
将ASP:DropDownList的ID = dd_approve RUNAT = 服务器 WIDTH = 300像素 >
将/ ASP:DropDownList的>
将/ ASP:TableCell的>< / ASP:的TableRow

解决方案
这听起来像你想要的动态更新下拉列表。这将需要一些JavaScript。谷歌是你的朋友。有吨的例子给你:的动态搜索aps.net组合框 [ ^ ]


检查这些jquery插件

示例 - 选择2 [ ^ ]

选择:jQuery插件选择框 [ ^ ]

这是另一个建议。您也应该像其他成员一样使用谷歌。



自动完成| jQuery UI [ ^ ]

hello,
I have dropdown for display name..
when i click on dropdown and typing starting letter of the name, then dropdownlist must show names only which start with letter what i typed..
"for example..when click on dropdownlist and type 'm' word, list of name started with 'm' will show.
Does anyone know how to do this?

What I have tried:

<asp:TableRow>
                    <asp:TableCell>
                        <asp:Label ID="lbl_approve" runat="server" Text="APPROVAL BY :"></asp:Label></asp:TableCell><asp:TableCell>
                            <asp:DropDownList ID="dd_approve" runat="server" Width="300px"  >
                            </asp:DropDownList>
                        </asp:TableCell></asp:TableRow

解决方案

It sounds like you want to dynamically update the dropdown. This will require some javascript. Google is your friend. There are tons of examples for you: dynamic search aps.net combobox[^]


check these jquery plugins
Examples - Select2[^]
Chosen: A jQuery Plugin Select Boxes[^]


Here is another suggestion. You should Google it too just like other member suggested.

Autocomplete | jQuery UI[^]


这篇关于如何使用ASP.NET在HTML中使用下拉选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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