Click here to Skip to main content
15,906,467 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to implement a google model search box in asp.net webform
Posted
Comments
Nelek 5-Apr-14 5:28am    
Step 1) Do a little research. Google is a good start point
Step 2) Start coding
Step 3) Compile and use the debug to solve little issues
Step 4) When you get a problem you don't know how to solve but at least you tried it, then come back and ask for something concrete with a snippet of the code giving problems

Sorry if this is not the answer you were looking for. But your question is a bit too wide to be answered at the "Quick" Answers. It is better and you get faster help if you make 10 concrete questions about concrete problems, than a big question about a "how-to guide"

1 solution

Here is a complete working example:

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title></title>
    <script>
        (function () {
            var cx = '012117305473792254352:kosbw5yycts';
            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>
 
</head>
<body>
    <form id="form1"  runat="server">
    <div>
        <gcse:search xmlns:gcse="#unknown"></gcse:search>
    </div>
    </form>
</body>
</html>



This answer was originally posted at:

How do I use google search on my webiste?[^]

You can generate your key and complete tutorial from below link:

https://www.google.com/cse/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900