Wednesday, 4 April 2012

Using AdRotator in Asp.Net

To use AdRotator in Asp.Net you need to follow the following steps:

1. Create an aspx page, AdRotator.aspx

2. Add an AdRotator control to your page
Here AdvertisementFile contains url of the XML file, which is used to store the ad information.

3. Add an XML file to your project, adrotator.xml, the XML file must begin and end with an <Advertisements> tag. Inside the  <Advertisements> tag there may be several <Ad> tags which defines each ad.

adrotator.xml:

  
    Images/ad1.jpg
    http://www.google.com
    Alternate Text 1
    Keyword 1
    10
  
  
    Images/ad2.jpg
    http://www.google.com
    Alternate Text 2
    Keyword 2
    20
  
  
    Images/ad4.jpg
    http://www.google.com
    Alternate Text 3
    Keyword 3
    40
  


Here,
<ImageUrl>          The path to the image file
<NavigateUrl>      The URL to link to if the user clicks the ad
<AlternateText>    An alternate text for the image
<Keyword>          A category for the ad
 <Impressions>    The display rates in percent of the hits

No comments:

Post a Comment