Search code examples
asp.netgoogle-custom-search

Integrating Google Custom Search for ASP.Net Web Application


I'm having the code for integrating Google Custom search into one of the ASP.Net websites. Google provided a script tag with an element to be placed on the website as gcse:search

However, when I place the code in the body content warning displayed as shown in the screenshot snapshot with warning message. Ignoring the warning message, the content is not properly rendered (text entered remains invisible) as shown snapshot from UI.

When I place the same code in static html page, code works perfect. Is there a way to include the element/tag as mentioned as a recognized namespace in asp.net web app & how? I cannot register that as a tag in asp.net since it's not a library.Thanks in advance!


Solution

  • You can try using the HTML5 compliant method described here: https://developers.google.com/custom-search/docs/element#html5