Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

More...

Forums » .NET » ASP.NET »

Adrotator Control in asp.net


Posted Date: 15 Jun 2012      Posted By:: esoftweb     Member Level: Bronze    Member Rank: 3279     Points: 1   Responses: 5



I have to place my advertise in adrotator control.I have to set 3 advertisement in adrotator control.send code for that



Responses

#675605    Author: Prasad kulkarni        Member Level: Diamond      Member Rank: 8     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 3

The AdRotator control is used to display a sequence of ad images

check for follwoing example

<Advertisements>
<Ad>
<ImageUrl>~/1.gif</ImageUrl>
<NavigateUrl>http://www.test.com</NavigateUrl>
<AlternateText>test1</AlternateText>
<Keyword>Site1</Keyword>
</Ad>
<Ad>
<ImageUrl>2.gif</ImageUrl>
<NavigateUrl>http://www.test2.com</NavigateUrl>
<AlternateText>test2</AlternateText>
<Keyword>Site2</Keyword>
</Ad>
</Advertisements>


hoe it helps

Thanks
Koolprasd2003
[DotNetSpider MVM]



 
#675614    Author: Anil Kumar Pandey      Member Level: Platinum      Member Rank: 1     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 4

Here is a sample code for the Ad Rotator control in ASP


<asp:AdRotator id="AdRotator1"
Target="_self"
AdvertisementFile="Image.xml"
runat="server"/>


<Advertisements>

<Ad>
<ImageUrl>Sample.jpg</ImageUrl>
<NavigateUrl>http://www.mannpandey.blogspot.com</NavigateUrl>
<AlternateText>test</AlternateText>
<Impressions>50</Impressions>
<Keyword>Sample</Keyword>
</Ad>

<Ad>
<ImageUrl>sample2.jpg</ImageUrl>
<NavigateUrl>http://www.mannpandey.blogspot.com</NavigateUrl>
<AlternateText>test</AlternateText>
<Impressions>75</Impressions>
<Keyword>Sample2</Keyword>
</Ad>

</Advertisements>


Thanks & Regards
Anil Kumar Pandey
Microsoft MVP, DNS MVM



 
#675616    Author: Pawan Awasthi      Member Level: Diamond      Member Rank: 4     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 4

Hai ESoftWeb,
To use the AdRotator control, you need to create and xml file which will contain the attributes and elements used for the images to display.
Create an Advertisement file as:

<Advertisements>
<Ad>
<ImageUrl>~/MyFirstImage.gif</ImageUrl>
<NavigateUrl>http://www.MyFirstImage.com</NavigateUrl>
<AlternateText>My First Image</AlternateText>
<Keyword>My First Image</Keyword>
</Ad>
<Ad>
<ImageUrl>~/MySecondImage.gif</ImageUrl>
<NavigateUrl>http://www.MySecondImage.com</NavigateUrl>
<AlternateText>My Second Image</AlternateText>
<Keyword>My Second Image</Keyword>
</Ad>
</Advertisements>

Now this file should be saved with the name 'MyAdFile.xml' in your application. Provide the path to this file in your AdRotator control, AdvertisementFile property.

<asp:AdRotator id="AdRotator1" Target="_self" AdvertisementFile="MyAdFile.xml" runat="server"/>

Hope it will be helpful to you.

Regards,
Pawan Awasthi(DNS MVM)
+91 8143683708 (pawansoftit@gmail.com)
Outstanding Contribution Award..NTT Data Inc






 
#675620    Author: Ultimaterengan        Member Level: Gold      Member Rank: 9     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 4


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<p>
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="Adv.xml"
Height="50%" Width="50%" />
</p>
</form>
</body>
</html>


<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>Images\Sunset.jpg</ImageUrl>
<NavigateUrl>http://www.dotnetspider.com</NavigateUrl>
<AlternateText>Dotnet website</AlternateText>
<Impressions>1</Impressions>
<Keyword>ProductInfo</Keyword>
</Ad>
<Ad>
<ImageUrl>Images\Winter.jpg</ImageUrl>
<NavigateUrl>http://www.microsoft.com/technet</NavigateUrl>
<AlternateText>Support for IT Professionals</AlternateText>
<Impressions>40</Impressions>
<Keyword>Support</Keyword>
</Ad>
<Ad>
<ImageUrl>Images\Sunset.jpg</ImageUrl>
<NavigateUrl>http://msdn.microsoft.com</NavigateUrl>
<AlternateText>Support for developers</AlternateText>
<Impressions>40</Impressions>
<Keyword>Support</Keyword>
</Ad>
</Advertisements>




Thanks & Regards
G.Renganathan
Nothing is mine ,Everything is yours!!!


http://renganathan1984.blogspot.com/



 
#675706    Author: Ravindran        Member Level: Diamond      Member Rank: 3     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 4

Try like below code sample


<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>~/images/image1.jpg</ImageUrl>
<AlternativeText>Blue hills</AlternativeText>
</Ad>
<Ad>
<ImageUrl>~/images/image2.jpg</ImageUrl>
<AlternativeText>Water lilies</AlternativeText>
</Ad>
<Ad>
<ImageUrl>~/images/image3.jpg</ImageUrl>
<AlternativeText>Water lilies</AlternativeText>
</Ad>
</Advertisements>


And code like below

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
</asp:Timer>
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/Add.xml" />


Regards
N.Ravindran
Your Hard work never fails



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Authenticated Login Page in C#
Previous : Tree view Expand image not align properly
Return to Discussion Forum
Post New Message
Category:

Related Messages
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.