SIGN UP MEMBER LOGIN:    
ARTICLE

Google Custom Searching in ASP.Net

Posted by Abhimanyu Kumar Vatsa Articles | ASP.NET Programming June 09, 2010
In this article, we will learn how to use Google Custom Searching method in ASP.Net website.
Reader Level:

Introduction

In many huge contented websites it is very difficult to find some information like any link, page, text etc. So, they use a textbox where visitor types his keyword to search. There are couple of ways to create it like, to search the content from database, crawler. But if you don't have such things then we use Google Custom Search. In Google Custom Search, we create account in Google and provide the domain information to Google and then Google generates some codes which are used inside our web application. If we use the Google Custom Search codes in our application, then Google searches the content from your website. It is available in cost-free and paid also. In cost-free there will be some advertisement of Google.

Let's take a look how to create it.

Creating Account in Google Custom Search

To create Google Custom Search account use the following link
http://www.google.com/cse/

Click above link to create Google Custom Search, you will find a form as given below.

google1.gif

At the end of this process you will receive some codes generated by Google and you have to keep it for use inside web application. Here is code given Google for my own domain ITORIAN.COM.

<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/cse/api/014464787619631746113/cse/67a_iw-duna/gadget&amp;synd=open&amp;w=250&amp;h=100&amp;title=ITORIAN+Search&amp;border=%23ffffff%7C0px%2C1px+solid+%23998899%7C0px%2C1px+solid+%23aa99aa%7C0px%2C2px+solid+%23bbaabb%7C0px%2C2px+solid+%23ccbbcc&amp;output=js"></script> 

And I have used it inside the <div> tag in web page, as given below

<div>
<
script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/cse/api/014464787619631746113/cse/67a_iw-duna/gadget&amp;synd=open&amp;w=250&amp;h=100&amp;title=ITORIAN+Search&amp;border=%23ffffff%7C0px%2C1px+solid+%23998899%7C0px%2C1px+solid+%23aa99aa%7C0px%2C2px+solid+%23bbaabb%7C0px%2C2px+solid+%23ccbbcc&amp;output=js"></script>
</div>

It is screenshot of my web page where I have used above code.

google2.gif

HAVE A HAPPY CODING!
 

Login to add your contents and source code to this article
share this article :
post comment
 

thank you coder

Posted by pavan shetty May 19, 2011

why not......

best of luck

Posted by Abhimanyu Kumar Vatsa Jun 21, 2010

hey. am planning to do a computer  lab monitoring system.can you please help me with creation of custom searching and blocking of websites

Posted by Amal Babu Jun 20, 2010
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor