Adam Beal BizTalk, .NET 2.0, and More

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

BizTalk Blogs

Dev Sites

Subscriptions

Post Categories



Google Adsense Search in an ASP.NET Page

Tonight I tried to add Google's AdSense search code to the right nav area on my site. According to the Google AdSense site all I should have to do is paste the google script code in my page. The problem was that Google's script is an HTML form.
This obviously didn't work because of the problems with nested form tags in an ASP.NET page. Here is how I ended up getting around this. I moved the above code into it's own html file you can view here. Then in my right nav ascx file I included the following iframe code which loads the html page in the frame and allows the form to post as intended:

<IFRAME name=SearchFrame src="pt_google_search.htm" frameBorder=0 width="98%" scrolling=no height=112>
    <a href="pt_google_search.htm">Search Page</a>
</IFRAME>

This is also a useful technique to use with some PayPal scripts which run in an HTML form.

posted on Friday, December 16, 2005 10:30 PM by adambeal


# re: Google Adsense Search in an ASP.NET Page @ Wednesday, June 06, 2007 12:20 AM

very helpful

balagh

# re: Google Adsense Search in an ASP.NET Page @ Wednesday, July 04, 2007 12:47 PM

nice

yaniv

# re: Google Adsense Search in an ASP.NET Page @ Thursday, October 04, 2007 12:33 PM

Exactly what I was looking for. Thanks!

Ryan

# re: Google Adsense Search in an ASP.NET Page @ Friday, November 09, 2007 6:59 PM

Thanks - perfect solution

Peta

# re: Google Adsense Search in an ASP.NET Page @ Monday, November 26, 2007 2:23 AM

Perfect, i like your solution

Post your ads for free on http://www.telists.com/

Taoufik

# re: Google Adsense Search in an ASP.NET Page @ Saturday, December 08, 2007 9:35 PM

Really Helpfull

Ramana

# re: Google Adsense Search in an ASP.NET Page @ Sunday, January 13, 2008 9:09 AM

Best tip ever

Bernardo

# re: Google Adsense Search in an ASP.NET Page @ Wednesday, January 30, 2008 2:13 AM

Thank you. Worked perfectly.

Edgar

# re: Google Adsense Search in an ASP.NET Page @ Wednesday, March 05, 2008 6:14 PM

This is what i was exactly looking for. Many many Thanx for your help.

Farooq

# re: Google Adsense Search in an ASP.NET Page @ Thursday, March 20, 2008 12:53 AM

Thanks buddy

Naeem

# re: Google Adsense Search in an ASP.NET Page @ Friday, May 23, 2008 4:01 AM

Hello,
Thanks a lot for your tip.

I have placed goggle search code in google_search.html and placed in IFRAME in default.aspx.

I am using goggle custom search.

The problem is; when i click on search button it is opening the search page (searchresult.html) but i am not able to come back to previous page (default.aspx).

Could you help?

Thanks!
Srikanth.

Srikanth




Powered by Dot Net Junkies, by Telligent Systems