Link to home
Start Free TrialLog in
Avatar of countrymeister
countrymeister

asked on

How to implement the Google Search in ASP.NET website

I registered my website with Google CSE, and they provided the following script
 
<script>

  (function() {

    var cx = 'XYZ0000';

    var gcse = document.createElement('script');

    gcse.type = 'text/javascript';

    gcse.async = true;

    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +

        '//www.google.com/cse/cse.js?cx=' + cx;

    var s = document.getElementsByTagName('script')[0];

    s.parentNode.insertBefore(gcse, s);

  })();

</script>

I added the script just above the closing head tag of my master page.

Then I added the search box in the location where I want my google search box to be displayed
<gcse:searchbox></gcse:searchbox>

Visual Studio displays a warning stating - 'Unrecognized namespace - gsce'
The code compiles but I cannot see my google search box.
I am using IIS7 and VS 2010
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of countrymeister
countrymeister

ASKER

I've requested that this question be deleted for the following reason:

I RESOLVED MY ISSUE
how?