ASP.NET AdRotator Control

ASP.NET Adrotator Control displays images in a sequence mode, and this Control can be used for Advertisement elements. ASP.NET AdRotator Control stores the Advertisement’s information in an XML file.

The following code snippet shows how to initiate the XML file.

<Advertisements>
<Ad>
<ImageUrl>/banners/ad1.gif</ImageUrl>
<NavigateUrl>http://www.aspnetbook.com</NavigateUrl>
<AlternateText>Main Site</AlternateText>
<Impressions>10</Impressions>
<Keyword>Keywords Here</Keyword>
</Ad>
</Advertisements>

Within these tags there can be many <Ad></Ad> tags, these are used to define different advertisements

Here is a quick tutorial on how to add your very own ASP.NET Adrotator Control to your .aspx page.

  1. Go to the Toolbox and under the Standard section, select AdRotator Control.

ASP.NET AdRotator Control
ASP.NET AdRotator Control

  1. Drag and drop it onto the Form area to declare it.
  2. The following is the code excerpt you get in the Source View.

<asp:AdRotator ID=”AdRotator1″ runat=”server” />

For more on how to use ASP.NET Adrotator Control check out the examples at www.aspnetbook.com

Related Tutorials:

This entry was posted in ASP.NET Tutorial and tagged , , , , , . Bookmark the permalink.