• Now Online : 79
  • admin@codemyne.net

Introduction

An advertisement can be of two types.

  1. Static
  2. Dynamic

In static advertisement all the clients given with same advertisement. This can be created using hyperlink. Where as dynamic advertisements will be created dynamically when client request comes to webpage. In this case different clients will be given with different advertisements.

This requires Adrotator Control.

Adrotator Control : Adrotator control will display/rotate different advertisements to different clients on the webpage. This requires 2 Steps :

  1. Preparing advertisement file (An XML File)
  2. Providing advertisement file to Adrotator control.

Advertisement File : In ASP 3.0 advertisement file is a text file.Where as in Asp.Net it is an XML file. This provides more flexibility compared to text file.The XML file is case sensitive.

Sample XML File for Advertisements :

<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>~\Images\post1.png</ImageUrl>
<NavigateUrl>http://www.codemyne.net</NavigateUrl>
<AlternateText>Advertisement</AlternateText>
<Impressions>50</Impressions>
<Keyword>Header</Keyword>
<Category>Script</Category>
</Ad>
<Ad>
<ImageUrl>~\Images\get1.png</ImageUrl>
<NavigateUrl>http://www.codemyne.net</NavigateUrl>
<AlternateText>Advertisement</AlternateText>
<Impressions>50</Impressions>
<Keyword>Header</Keyword>
<Category>Script</Category>
</Ad>
</Advertisements>

  • Ad tag will represent one advertisement information.
  • ImageUrl will represent advertisement image.
  • NavigationUrl will represent advertisement page.
  • AlternateText will represent tooltip text.
  • Height and width will specify size of advertisement image. If it is not provided the image will be sized according to the adrotator size.
  • Impression will specify priority[importance] to advertisements. The Ad with more impressions given to more number of clients.
  • The Keyword is required to categorize advertisements.
Attaching Xml file to Adrotator : Place an Adrotator on a webpage and privde the XML file path as shown below

<asp:AdRotator ID="AdRotator1" runat="server" 
AdvertisementFile="~/AdInfo.xml" Target="_blank" 
ToolTip="Click here to go to Queries " />

Note : The Above advt will be changed when you refresh the page at a regular interval.
Adrotator will be used in this way.

Happy coding...

Comments Post a Comment