troubleshooting Question

How to implement the Google Search in ASP.NET website

Avatar of countrymeister
countrymeister asked on
JavaScriptWeb DevelopmentASP.NET
3 Comments1 Solution1257 ViewsLast Modified:
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
leakim971
Multitechnician
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros