There are some demos of Adverting control. They're based upon this XML, take a look at the documentation for more infos.
For simplicity in these demos I've used only local image banners, but it's clear that inside CDATA section of the units you can specify any sort of html, from AdSense, AdBrite or any other marketing companies.
Extract banners form vendor group
This Ads will extract a random unit filtering the property group of the vendors, we want only banners from "orangeVendor" group, so we set Type="randomFiltered" FilterVendorGroup="orangeVendor".
<rec:Advertising ID="adsOrange" runat="server" XMLUrl="~/xml/Advertising.xml"
Type="randomFiltered" FilterVendorGroup="orangeVendor" />
Extract banners by group
Also the units can be assigned to a specific group, and you can use it to filter them. In this example we extract only units with group equals to "graphic".
<rec:Advertising ID="adsUnits" runat="server" XMLUrl="~/xml/Advertising.xml" Type="randomFiltered"
FilterUnitGroup="graphic" />
Extract banners with specified width/height
We can extract ads filtering their width and height, as we set it on the XML. These units contains a link, just for test.
 |
Lorem ipsum at latine pertinacia intellegam ius, reque numquam tincidunt sea at. No facilisi indoctum dignissim mel, vis ad lorem dicit sententiae. Alienum menandri sapientem vis ut, probo splendide intellegebat te vix. Iisque dolorem reformidans eos an, sed volutpat tractatos salutatus id, nam wisi fastidii posidonium id. Eu omittam disputando per, has vocibus salutatus adipiscing ne. |
 |
As you can see, the randomized units are every different, thanks to the property PreventsBannerDuplication, true by default.
<table>
<tbody>
<tr>
<td>
<rec:Advertising ID="ads200x200_1" runat="server" XMLUrl="~/xml/Advertising.xml"
Type="randomFiltered" FilterUnitHeight="200" FilterUnitWidth="200" />
</td>
<td><p>Lorem ipsum ....</p></td>
<td>
<rec:Advertising ID="ads200x200_2" runat="server" XMLUrl="~/xml/Advertising.xml"
Type="randomFiltered" FilterUnitHeight="200" FilterUnitWidth="200" />
</td>
</tr>
</tbody>
</table>
Extracts a specific banner
If you want a specific unit just use the Type exact and indicate IDVendor and IDUnit (or only IDUnit, if you're sure it's unique).
<rec:Advertising ID="adsExact" runat="server" XMLUrl="~/xml/Advertising.xml" Type="exact"
IDVendor="vendorThree" IDUnit="unit1_2" />
Full random
Finally we can set a full random banner. By setting the property PreventsBannerDuplication="false" it can extract units already used in the random and randomFiltered banners.
<rec:Advertising ID="adsRandom" runat="server" XMLUrl="~/xml/Advertising.xml" Type="random"
PreventsBannerDuplication="false" />