使用AJAX进行搜索----类似于Google搜索 [英] SEARCH USING AJAX ---- like google search

查看:100
本文介绍了使用AJAX进行搜索----类似于Google搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生,

我有一个项目,需要在我的网络表单上进行搜索.

我只用了文本框和Gridview而不需要搜索按钮,我有一个很大的数据库,并且已经在Gridview中填充了数据.

现在我需要使用AJAX TEXTBOX搜索数据.当用户在文本框中键入内容时,它应显示在下面的gridview中.


请任何人都可以为我提供完美的解决方案.

谢谢,

Dear Sir,

I have a project i need Search on my webform.

I took only textbox and Gridview no need of search button, I have a large database and already i haved filled the data in gridview.

NOW i need to search the data using AJAX TEXTBOX. when the user types something in textbox it should displays in gridview below.


Please any one can give me the perfect solution for this.

Thanks,

推荐答案

可以有多种方法.如果您只是根据类型化的数据询问建议,则 AJAX自动完成控件 [ ^ ]会很好.

现在,由于您需要与gridview中的键入字母相关的数据,因此建议您使用XMLHttpRequest(传统AJAX).这将使您能够将类型化的数据传递给服务器,然后根据类型化的数据从服务器取回gridview数据.

在此处查找 XMLHttpRequest :
XMLHttpRequest对象 [带有示例的XMLHTTPRequest [使用XML HTTP请求对象 [使用XMLHTTPRequest对象进行客户端验证 [
There are multiple ways to do it. Had you just asked for suggestions based on the typed data then AJAX AutoComplete control[^] would have fit in good.

Now, since you need the data related to typed letters in the gridview, I would suggest you to use XMLHttpRequest (traditional AJAX). This would give you the ability to pass on the typed data to server and then get back gridview data from server based on the typed data.

Look here for XMLHttpRequest:
XMLHttpRequest Object[^]
XMLHTTPRequest with Sample[^]
Using the XML HTTP Request object[^]
Client Side Validation Using the XMLHTTPRequest Object[^]


这篇关于使用AJAX进行搜索----类似于Google搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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