Add AdSense for Search in .net pages

Posted on Thursday, July 10, 2008 by Krish Tags: ,
Category: Bloging, General, Google, Programing, Adsense, Tips

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.




Post Calendar

<<  May 2012  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910