PDA

View Full Version : display rotating ads



Freon22
02-06-2006, 04:28 PM
I am moving into asp.net, having fun so far. When I was coding in vbscript I never messed with the rotating ads. But now I see where I can use it on one or two pages.

Anyway I wanted to run some test before I tryed to code it into my pages. The problem I am having is when I run this test page it will only rotate between the first three ads. I have even tryed to use the Keyword Filter to see if I can force it to display an ad below the first three but it won't.

Here is the code for the display page.


<body>
<center>

<form id="Form2" action="intro5.aspx" method="post" runat="server">

<asp:adrotator ID="Adrotator1" AdvertisementFile="ads.xml" BorderColor="black" BorderWidth=1 KeywordFilter="Races" runat="server" />



<h3> Name: <asp:textbox id="Name" runat="server"/>

Category: <asp:dropdownlist id="Category" runat=server>
<asp:listitem >psychology</asp:listitem>
<asp:listitem >business</asp:listitem>
<asp:listitem >popular_comp</asp:listitem>
</asp:dropdownlist>
</h3>

<asp:button ID="Button1" text="Lookup" runat="server"/>

</form>

</center>

</body>


Here is the xml page


<Advertisements>

<Ad>
<ImageUrl>images/human.gif</ImageUrl>
<NavigateUrl>http://freon22.net</NavigateUrl>
<AlternateText>Human</AlternateText>
<Keyword>Races</Keyword>
<Impressions>50</Impressions>
</Ad>

<Ad>
<ImageUrl>images/alskant.gif</ImageUrl>
<NavigateUrl>http://freon22.net</NavigateUrl>
<AlternateText>Alskant</AlternateText>
<Keyword>Races</Keyword>
<Impressions>50</Impressions>
</Ad>

<Ad>
<ImageUrl>images/ikthorne.gif</ImageUrl>
<NavigateUrl>http://freon22.net</NavigateUrl>
<AlternateText>Ik'Thorne</AlternateText>
<Keyword>Races</Keyword>
<Impressions>50</Impressions>
</Ad>

<AD>
<ImageUrl>images/salvene.gif</ImageUrl>
<NavigateUrl>http://freon22.net</NavigateUrl>
<AlternateText>Salvene</AlternateText>
<Keyword>Races</Keyword>
<Impressions>50</Impressions>
</AD>

<AD>
<ImageUrl>images/creonti.gif</ImageUrl>
<NavigateUrl>http://freon22.net</NavigateUrl>
<AlternateText>Creonti</AlternateText>
<Keyword>Races</Keyword>
<Impressions>50</Impressions>
</AD>

<AD>
<ImageUrl>images/thevian.gif</ImageUrl>
<NavigateUrl>http://freon22.net</NavigateUrl>
<AlternateText>Thevian</AlternateText>
<Keyword>Races</Keyword>
<Impressions>50</Impressions>
</AD>

<AD>
<ImageUrl>images/wqhuman.gif</ImageUrl>
<NavigateUrl>http://freon22.net</NavigateUrl>
<AlternateText>WQ Human</AlternateText>
<Keyword>Races</Keyword>
<Impressions>50</Impressions>
</AD>

</Advertisements>


Any idea what I am doing wrong?

Thanks for taking the time to look at this post.

hytechpro
02-07-2006, 06:44 AM
I think this is ok
but how can we place a flesh file in addrotator
can u giv code for xml file for this

Freon22
02-07-2006, 01:22 PM
Thanks guys for looking at this but I found the trouble. I went over this code letter by letter looking for an error. I could not fine any. Guess what? Its case sensitive. I had <Ad></Ad> and <AD></AD>. The first three were <Ad> and after that they are <AD>. lol

I just didn't see it :-) well they say live and learn. Moving to ASP.NET its my turn to do some learning.

ghell
02-13-2006, 06:08 PM
xml should all be lower case anyway.. in theory