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
ASP.NETWeb DevelopmentJavaScript

Avatar of undefined
Last Comment
leakim971

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
leakim971

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
countrymeister

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

I RESOLVED MY ISSUE
leakim971

how?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy