在谷歌搜索 [英] Search in google

查看:107
本文介绍了在谷歌搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

我有一个搜索功能,它会在gridview中使用ajax搜索数据(在你输入时搜索)。

我接下来要实现的是,假设在搜索数据时未找到数据,它必须从谷歌搜索的互联网基础上获取关键词(在文本框中输入)。



任何想法怎么做?

Hi.
I have a search function where it will search for data in gridview using ajax (search as you type).
What i want to implement next is, lets say if data not found while searching for data,it must get the keyword (entered in the textbox) information from the internet base on google search.

Any ideas how to do this?

推荐答案

Google有一个Web服务,您可以使用search参数调用该服务来获取搜索结果。以下是一个链接,显示了使用Web服务并在DataList中显示结果的示例。你应该不难在GridView中显示结果。



见这里:



http://www.4guysfromrolla.com/articles/030503-1.aspx [ ^ ]







http:// www .4guysfromrolla.com / articles / 030503-1.2.aspx [ ^ ]



好​​运。
Google has a web service that you can invoke with search parameter to get the search result. Following is a link that shows an example of using the web service and showing the results in a DataList. It shouldn't be hard for you to show the results in a GridView.

See here :

http://www.4guysfromrolla.com/articles/030503-1.aspx[^]

And

http://www.4guysfromrolla.com/articles/030503-1.2.aspx[^]

Best of luck.


嗨。

我几乎就在那里。代码在后面:



Hi.
I m almost there.The code is here at behind:

protected void Button1_Click(object sender, EventArgs e)
        {
          Response.Redirect("http://www.google.com/search?hl=en&q=" + TextBox1.Text.ToString() + "");  // TextBox1.Text contains the  text  entered  by  the  user
        }





但我有一个问题。在谷歌搜索文本框中输入的关键字,但它在浏览器中加载一个新页面。我想要单击按钮时要在iframe中加载的确切页面。



有什么想法吗?



But i have one problem with it.The keyword entered in the textbox search in google,but it load a as a new page in browser.I want the exact page to be loaded in iframe when click the button.

Any ideas?


这篇关于在谷歌搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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