how to create the AdRotator control with .Net

Posted by Neeks under ASP.NET category on | Views : 4010
code for your ASPX page
You have to write this code in your ASPX page means you have to take the AdRotator control to display the Advertisement
This has a Property say AdvertisementFile which accepts the XML file name as a Value.
So, you can add the Folowing code in your ASPX page to take the control.

. Your HTML Code
<asp:adrotator runat="server" AdvertisementFile="~/AddRotetor/Advert.xml" >
. Your HTML Code

Now, its time to create a XML file for the Advertisement.
The file will be created in the following format.
Code for the XML file [Advert.xml]
<?xml version="1.0" encoding="utf-8" ?>
<!--This advertisement file has Pre-defined tags-->
<!--You can remove unnecessary tags-->
<!--You can have more than one <Ad></Ad> tags but there must be <Advertisements></Advertisements> Tag only once.-->
<Advertisements> <!--This is a main tag for the advertisement-->
<Ad> <!--You can create the tag Ad for specifying multiple Advertisements-->
<ImageUrl>one.gif</ImageUrl> <!--This Tag is used to provide the detail of Images-->
<AlternateText>This is the First Add</AlternateText> <!--This Tag is used for the alternate Text when Images are not loaded-->
<NavigateUrl></NavigateUrl> <!--This tag is used to navigate the URL-->
<Impressions>1</Impressions> <!--This tag displays the rate in percent of the hits-->

Comments or Responses

Posted by: Poster on: 2/20/2009 Level:Starter | Status: [Member]
Hello Neeks,

Thanks for your posts. I have a request, please do not mind. It would be good if you can explain your post a bit to make it understandable easily.


Posted by: Neeks on: 2/20/2009 Level:Bronze | Status: [Member]
Thanks for your response.
I have changed the code.
Please let me know if there is still any query,

Login to post response