How to Display Google Search Result in my Asp.net application

Posted by Kalairockzz under ASP.NET on 5/22/2013 | Points: 10 | Views : 2259 | Status : [Member] | Replies : 4
Hi,
I have created an Asp.net Application which search box. While I submit the query in my application it should call the google search result and it should be displayed in my application rather than redirecting to google page.




Responses

Posted by: Ankitsrist on: 5/22/2013 [Member] Starter | Points: 25

Up
0
Down
use the google custom search api from your gmail account it will automatically generate code

Kalairockzz, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mandlaa on: 5/22/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Kalairockzz can you provide me the complete code for How to Display Google Search Result in my Asp.net application

Kalairockzz, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ankitsrist on: 5/22/2013 [Member] Starter | Points: 25

Up
0
Down
here is the code
<div><script type ="text/javascript">

(function() {
var cx = your generated key goes here';
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>
<gcse:search>--%><%--</gcse:search></div>


Kalairockzz, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kalairockzz on: 5/27/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Ankitsrist
If am using the google API, I can able to search only for the particular website. For example if am using www.justdial.com script am getting the answer which is relevant to the justdial alone. But i need the answer in general (ie) which is displaying in google.

Kalairockzz, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response