我有一个简单的asp.net文本框和旁边的搜索按钮。 用户可以在文本框中编写一些文本,然后单击搜索。 单击搜索按钮时,我需要执行数据检索并在文本框下方的下拉列表中显示结果。
请查看下面的图片以获取插图:
到目前为止,我将结果显示在一个单独的GridView中,如何将其显示为如下所示的下拉列表?
I have a simple asp.net Textbox and a search button next to it. The user would write some text in the Textbox and then click search. When the search button is clicked, I need to perform data retrieval and display the results in a dropdownlist below the textbox.
Please check the image below for illustration:
So far I display the results in a separate GridView, how can I display it as a dropdown as shown?
最满意答案
如果您已经知道数据,可以使用此属性:
https://msdn.microsoft.com/fr-fr/library/system.windows.forms.textbox.autocompletemode%28v=vs.110%29.aspx
或者您可以在数据库中搜索并使用JQuery自动完成和Ajax调用显示结果。
使用ASP.NET的JQuery UI自动完成的有效方法
May you can use this property if you already knows the datas :
https://msdn.microsoft.com/fr-fr/library/system.windows.forms.textbox.autocompletemode%28v=vs.110%29.aspx
Or you can search in database and display result with a JQuery autocomplete and Ajax Call.
Efficient way of using JQuery UI Autocomplete with ASP.NET
更多推荐
发布评论