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('sc ript');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protoco l == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagN ame('scrip t')[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:sea rchbox>
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
<script>
(function() {
var cx = 'XYZ0000';
var gcse = document.createElement('sc
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protoco
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagN
s.parentNode.insertBefore(
})();
</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:sea
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
how?
ASKER
I RESOLVED MY ISSUE