Adam Beal BizTalk, .NET 2.0, and More

<September 2008>
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011


Navigation

BizTalk Blogs

Dev Sites

Subscriptions

Post Categories



Friday, December 16, 2005 - Posts

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 Friday, December 16, 2005 10:30 PM by adambeal with 12 Comments




Powered by Dot Net Junkies, by Telligent Systems