ASP.NET AdRotator Control Sample Code | Using AdRotator


AdRotator Control

AdRotator.aspx

<body>
    <table>
        <tr>
            <td>
                <asp:AdRotator ID="AdRotator1" runat="server" Height="70px" Width="200px"                                 AdvertisementFile="~/Ads.xml" />
            </td>
            <td>
                <asp:AdRotator ID="AdRotator2" runat="server" Height="70px" Width="200px"                                 AdvertisementFile="~/Ads.xml"  />
            </td>

            <td>
                <asp:AdRotator ID="AdRotator3" runat="server" Height="70px" Width="200px"                                 AdvertisementFile="~/Ads.xml" />
            </td>

            <td>
                <asp:AdRotator ID="AdRotator4" runat="server" Height="70px" Width="200px"                                 AdvertisementFile="~/Ads.xml" />
            </td>
        </tr>
    </table>
</body>

Ads.xml

<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
  <Ad>
    <ImageUrl>Sources/images/cognizant.gif</ImageUrl>
    <NavigateUrl>https://www.cognizant.com/</NavigateUrl>
  </Ad>
  <Ad>
    <ImageUrl>Sources/images/sharpland.jpg</ImageUrl>
    <NavigateUrl>http://www.sharpland.net</NavigateUrl>
  </Ad>
</Advertisements>



No comments:

Post a Comment