如何基于Ajax创建搜索功能? [英] How to make search functionality based on Ajax?

查看:72
本文介绍了如何基于Ajax创建搜索功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从表中搜索一个项目并在gridview上显示。我已经完成了在TextBox中输入项目名称并单击搜索按钮后搜索项目的功能,它工作正常。现在我想要当用户在TextBox中输入时,与给定键匹配的项目名称将显示在网格视图中。



例如我输入Hospital然后是Item name表格中包含医院的应该出现在网格视图中,当用户删除文本形式的TextBox时,不应该在gridview中显示任何内容。



我该怎么办?

I want to search an item from table and show on the gridview. I have done the functionality to search items after enter the item name in TextBox and click search button, it works fine. Now i want when user typing in TextBox the item name that matches with given key will be shown in grid view.

for example i type "Hospital" then the Item name that contain hospital in table should be appear in grid view and when user delete the text form TextBox, no content should be display in gridview.

how i can do it?

推荐答案

在textbox textchange事件中使用Dear Like Query或Contain Query。
Use Dear Like Query Or Contain Query in textbox textchange event.


这篇关于如何基于Ajax创建搜索功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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