Implementing Adrotator control - Free Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server,WCF,Entity framework snippets and tutorial

Implementing Adrotator control

In this article I am going to explain how to implement AdRotator control of

Adrotator control is used to show custom Ads (advertisements) on build websites. When users click on any ad they will be redirect to link assign for that. We can use both Xml and database as data source. Xml and database table must have following properties and columns: ImageUrl, NavigateUrl, AlternateText, Impressions, Keyword, Width and Height.

I am using Xml to implement this example. I have add Xml File.

Source of XML file (Adfile.xml)

<?xml version="1.0" encoding="utf-8" ?>
    <AlternateText>Pizza hut</AlternateText>
    <Keyword>Pizza hut</Keyword>

Add Adrotator control to webform. We have to pass xml file path to AdvertisementFile property of control.

Complete source of webform
<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
        <asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/AdFile.xml" Target="_blank"/>

What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.

Share this

Share on FacebookTweet on TwitterPlus on Google+