Technology, Smartphones, Games

Add AdSense for Search in .net pages

If you are trying to add AdSense for Search in your aspx (ASP.NET) pages, this will not work, since the aspx page already have a form tag and similarly  the code which is given by the Google.

So I don’t know whether this is the proper method to do it or not, but this will work for sure.

1. Create the search result page.

2. Create an HTML page (search_box.html)with the “Search Box Code” Google given and add target="_top" in the form tag, now which will  look like

<form action="search_results.aspx" id="cse-search-box" target="_top">

3. Add an Iframe in the page where you want to add the search box with src set to the page you created

<iframe src="search_box.html" frameborder="0" height="30px" scrolling="no" marginheight="0"></iframe>

That is it, You added AdSense for Search in your dotnet page. This method can be used for the blogengine  also, Add this in the Master page if you want to add it in all the pages.