1 Answer

0 votes
by

AdRotator controls are used to create a dynamic ads. The AdRotator Control presents ad images each time a user enters or refreshes a webpage. When the ads are clicked, it will navigate to a new Web location. The AdRotator control is used to display a sequence of ad images.The AdRotator control to work we need an Advertisement file (XML file) and some sample images.

Adding the AdRotator web server control to your web application. first, select the AdRotator and drag and drop the control to your web form. Map the XML file which contains the details about each and every ad.

The advertisement file is an XML file. The following are some of the elements of this XML file.

  1. <imageUrl>: Optional. The path to the image file.
  2. <NavigateUrl>: Optional. The URL to link to if the user clicks the ad.
  3. <AlternateText>: Optional. An alternate text for the image.
  4. <Impressions>: Optional. The display rates in percent of the hits.

XML code that has the details about the ads. The file Ads.xml looks like the code below:

  1. <Advertisements>  
  2.     <Ad>  
  3.         <ImageUrl>adimages/2.jpg</ImageUrl>  
  4.         <NavigateUrl>http://cat2.com</NavigateUrl>  
  5.         <AlternateText>Cat 2</AlternateText>  
  6.         <Impressions>30</Impressions>  
  7.     </Ad>  
  8.     <Ad>  
  9.         <ImageUrl>adimages/3.jpg</ImageUrl>  
  10.         <NavigateUrl>http://cat3.com</NavigateUrl>  
  11.         <AlternateText>Cat 3</AlternateText>  
  12.         <Impressions>20</Impressions>  
  13.     </Ad>  
  14.     <Ad>  
  15.         <ImageUrl>adimages/4.jpg</ImageUrl>  
  16.         <NavigateUrl>http://cat4.com</NavigateUrl>  
  17.         <AlternateText>Cat 4</AlternateText>  
  18.         <Impressions>10</Impressions>  
  19.     </Ad>  
  20. </Advertisements>  

Related questions

0 votes
0 votes
    How to use repeater control in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What is XAML in WPF and also explain the types of XAML?...
asked Apr 9, 2021 in Education by JackTerrance
0 votes
    Explain Cookie-less Session in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    Explain the concept of MVC Scaffolding?...
asked Apr 5, 2021 in Education by JackTerrance
0 votes
    Explain the need of display mode in MVC?...
asked Apr 5, 2021 in Education by JackTerrance
0 votes
0 votes
    What is ToolTip and how we use it in WPF?...
asked Apr 9, 2021 in Education by JackTerrance
0 votes
    What is a Routed event?...
asked Apr 9, 2021 in Education by JackTerrance
...