question about AdRotator

Discussion in 'ASP .Net Building Controls' started by Dan, May 22, 2007.

  1. Dan

    Dan Guest

    Hi,

    I created an AdRotator control with this code:
    <asp:AdRotator id="AdRotator1"
    Runat="Server" AdvertisementFile="adrotator.xml">
    </asp:AdRotator>

    The xml file contains:
    <Advertisements>
    <Ad>
    <ImageUrl>images/pic1.png</ImageUrl>
    <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    <AlternateText>Coca Cola</AlternateText>
    <Keyword>coca</Keyword>
    <Impressions>50</Impressions>
    </Ad>
    <Ad>
    <ImageUrl>images/pic2png</ImageUrl>
    <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    <AlternateText>Alfa Romeo</AlternateText>
    <Keyword>alfa</Keyword>
    <Impressions>50</Impressions>
    </Ad>
    </Advertisements>

    When running, i see the first advertising, but the second advertising never
    appears. Do i need some codebehind code to switch from advertisings or it
    must happen automatically?

    Thanks
    Dan
    Dan, May 22, 2007
    #1
    1. Advertising

  2. Howdy,

    <Advertisements
    xmlns="http://schemas.microsoft.com/AspNet/AdRotator-Advertisement-File-1.2">
    <Ad>
    <ImageUrl>~/Images/pic1.png</ImageUrl>
    <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    <AlternateText>Coca Cola</AlternateText>
    <Keyword>coca</Keyword>
    <Impressions>50</Impressions>
    </Ad>
    <Ad>
    <ImageUrl>~/Images/pic2.png</ImageUrl>
    <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    <AlternateText>Alfa Romeo</AlternateText>
    <Keyword>alfa</Keyword>
    <Impressions>50</Impressions>
    </Ad>
    </Advertisements>

    It should work, try to refresh the page few times and see if the image
    changes.

    hope this helps

    --
    Milosz


    "Dan" wrote:

    > Hi,
    >
    > I created an AdRotator control with this code:
    > <asp:AdRotator id="AdRotator1"
    > Runat="Server" AdvertisementFile="adrotator.xml">
    > </asp:AdRotator>
    >
    > The xml file contains:
    > <Advertisements>
    > <Ad>
    > <ImageUrl>images/pic1.png</ImageUrl>
    > <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    > <AlternateText>Coca Cola</AlternateText>
    > <Keyword>coca</Keyword>
    > <Impressions>50</Impressions>
    > </Ad>
    > <Ad>
    > <ImageUrl>images/pic2png</ImageUrl>
    > <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    > <AlternateText>Alfa Romeo</AlternateText>
    > <Keyword>alfa</Keyword>
    > <Impressions>50</Impressions>
    > </Ad>
    > </Advertisements>
    >
    > When running, i see the first advertising, but the second advertising never
    > appears. Do i need some codebehind code to switch from advertisings or it
    > must happen automatically?
    >
    > Thanks
    > Dan
    >
    >
    >
    Milosz Skalecki [MCAD], May 22, 2007
    #2
    1. Advertising

  3. Dan

    Dan Guest

    Hi Milosz,

    thanks for replying .. but i think there is a little misunderstanding ...
    When i refresh my page, the advertising also changes.That's not the problem.
    I thought the advertising would change by itself automatically.
    Is it wrong and must the page each time be refreshed for switching between
    advertisings?


    "Milosz Skalecki [MCAD]" <> schreef in bericht
    news:...
    > Howdy,
    >
    > <Advertisements
    > xmlns="http://schemas.microsoft.com/AspNet/AdRotator-Advertisement-File-1.2">
    > <Ad>
    > <ImageUrl>~/Images/pic1.png</ImageUrl>
    > <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    > <AlternateText>Coca Cola</AlternateText>
    > <Keyword>coca</Keyword>
    > <Impressions>50</Impressions>
    > </Ad>
    > <Ad>
    > <ImageUrl>~/Images/pic2.png</ImageUrl>
    > <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    > <AlternateText>Alfa Romeo</AlternateText>
    > <Keyword>alfa</Keyword>
    > <Impressions>50</Impressions>
    > </Ad>
    > </Advertisements>
    >
    > It should work, try to refresh the page few times and see if the image
    > changes.
    >
    > hope this helps
    >
    > --
    > Milosz
    >
    >
    > "Dan" wrote:
    >
    >> Hi,
    >>
    >> I created an AdRotator control with this code:
    >> <asp:AdRotator id="AdRotator1"
    >> Runat="Server" AdvertisementFile="adrotator.xml">
    >> </asp:AdRotator>
    >>
    >> The xml file contains:
    >> <Advertisements>
    >> <Ad>
    >> <ImageUrl>images/pic1.png</ImageUrl>
    >> <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    >> <AlternateText>Coca Cola</AlternateText>
    >> <Keyword>coca</Keyword>
    >> <Impressions>50</Impressions>
    >> </Ad>
    >> <Ad>
    >> <ImageUrl>images/pic2png</ImageUrl>
    >> <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    >> <AlternateText>Alfa Romeo</AlternateText>
    >> <Keyword>alfa</Keyword>
    >> <Impressions>50</Impressions>
    >> </Ad>
    >> </Advertisements>
    >>
    >> When running, i see the first advertising, but the second advertising
    >> never
    >> appears. Do i need some codebehind code to switch from advertisings or it
    >> must happen automatically?
    >>
    >> Thanks
    >> Dan
    >>
    >>
    >>
    Dan, May 22, 2007
    #3
  4. Howdy,

    It's just the way how it works (it requires a postback). You can find some
    nice resolutions to this limitation (i.e. if you use MS AJAX put adrotator
    inside an UpdatePanel). Anyway, it would involve javascript coding, for
    instance:
    http://www.brettb.com/js_banner_ad_rotator.asp

    Hope this helps
    --
    Milosz


    "Dan" wrote:

    > Hi Milosz,
    >
    > thanks for replying .. but i think there is a little misunderstanding ...
    > When i refresh my page, the advertising also changes.That's not the problem.
    > I thought the advertising would change by itself automatically.
    > Is it wrong and must the page each time be refreshed for switching between
    > advertisings?
    >
    >
    > "Milosz Skalecki [MCAD]" <> schreef in bericht
    > news:...
    > > Howdy,
    > >
    > > <Advertisements
    > > xmlns="http://schemas.microsoft.com/AspNet/AdRotator-Advertisement-File-1.2">
    > > <Ad>
    > > <ImageUrl>~/Images/pic1.png</ImageUrl>
    > > <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    > > <AlternateText>Coca Cola</AlternateText>
    > > <Keyword>coca</Keyword>
    > > <Impressions>50</Impressions>
    > > </Ad>
    > > <Ad>
    > > <ImageUrl>~/Images/pic2.png</ImageUrl>
    > > <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    > > <AlternateText>Alfa Romeo</AlternateText>
    > > <Keyword>alfa</Keyword>
    > > <Impressions>50</Impressions>
    > > </Ad>
    > > </Advertisements>
    > >
    > > It should work, try to refresh the page few times and see if the image
    > > changes.
    > >
    > > hope this helps
    > >
    > > --
    > > Milosz
    > >
    > >
    > > "Dan" wrote:
    > >
    > >> Hi,
    > >>
    > >> I created an AdRotator control with this code:
    > >> <asp:AdRotator id="AdRotator1"
    > >> Runat="Server" AdvertisementFile="adrotator.xml">
    > >> </asp:AdRotator>
    > >>
    > >> The xml file contains:
    > >> <Advertisements>
    > >> <Ad>
    > >> <ImageUrl>images/pic1.png</ImageUrl>
    > >> <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    > >> <AlternateText>Coca Cola</AlternateText>
    > >> <Keyword>coca</Keyword>
    > >> <Impressions>50</Impressions>
    > >> </Ad>
    > >> <Ad>
    > >> <ImageUrl>images/pic2png</ImageUrl>
    > >> <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    > >> <AlternateText>Alfa Romeo</AlternateText>
    > >> <Keyword>alfa</Keyword>
    > >> <Impressions>50</Impressions>
    > >> </Ad>
    > >> </Advertisements>
    > >>
    > >> When running, i see the first advertising, but the second advertising
    > >> never
    > >> appears. Do i need some codebehind code to switch from advertisings or it
    > >> must happen automatically?
    > >>
    > >> Thanks
    > >> Dan
    > >>
    > >>
    > >>

    >
    >
    >
    Milosz Skalecki [MCAD], May 22, 2007
    #4
  5. Dan

    Dan Guest

    Thanks again

    "Milosz Skalecki [MCAD]" <> schreef in bericht
    news:...
    > Howdy,
    >
    > It's just the way how it works (it requires a postback). You can find some
    > nice resolutions to this limitation (i.e. if you use MS AJAX put adrotator
    > inside an UpdatePanel). Anyway, it would involve javascript coding, for
    > instance:
    > http://www.brettb.com/js_banner_ad_rotator.asp
    >
    > Hope this helps
    > --
    > Milosz
    >
    >
    > "Dan" wrote:
    >
    >> Hi Milosz,
    >>
    >> thanks for replying .. but i think there is a little misunderstanding ...
    >> When i refresh my page, the advertising also changes.That's not the
    >> problem.
    >> I thought the advertising would change by itself automatically.
    >> Is it wrong and must the page each time be refreshed for switching
    >> between
    >> advertisings?
    >>
    >>
    >> "Milosz Skalecki [MCAD]" <> schreef in bericht
    >> news:...
    >> > Howdy,
    >> >
    >> > <Advertisements
    >> > xmlns="http://schemas.microsoft.com/AspNet/AdRotator-Advertisement-File-1.2">
    >> > <Ad>
    >> > <ImageUrl>~/Images/pic1.png</ImageUrl>
    >> > <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    >> > <AlternateText>Coca Cola</AlternateText>
    >> > <Keyword>coca</Keyword>
    >> > <Impressions>50</Impressions>
    >> > </Ad>
    >> > <Ad>
    >> > <ImageUrl>~/Images/pic2.png</ImageUrl>
    >> > <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    >> > <AlternateText>Alfa Romeo</AlternateText>
    >> > <Keyword>alfa</Keyword>
    >> > <Impressions>50</Impressions>
    >> > </Ad>
    >> > </Advertisements>
    >> >
    >> > It should work, try to refresh the page few times and see if the image
    >> > changes.
    >> >
    >> > hope this helps
    >> >
    >> > --
    >> > Milosz
    >> >
    >> >
    >> > "Dan" wrote:
    >> >
    >> >> Hi,
    >> >>
    >> >> I created an AdRotator control with this code:
    >> >> <asp:AdRotator id="AdRotator1"
    >> >> Runat="Server" AdvertisementFile="adrotator.xml">
    >> >> </asp:AdRotator>
    >> >>
    >> >> The xml file contains:
    >> >> <Advertisements>
    >> >> <Ad>
    >> >> <ImageUrl>images/pic1.png</ImageUrl>
    >> >> <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    >> >> <AlternateText>Coca Cola</AlternateText>
    >> >> <Keyword>coca</Keyword>
    >> >> <Impressions>50</Impressions>
    >> >> </Ad>
    >> >> <Ad>
    >> >> <ImageUrl>images/pic2png</ImageUrl>
    >> >> <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    >> >> <AlternateText>Alfa Romeo</AlternateText>
    >> >> <Keyword>alfa</Keyword>
    >> >> <Impressions>50</Impressions>
    >> >> </Ad>
    >> >> </Advertisements>
    >> >>
    >> >> When running, i see the first advertising, but the second advertising
    >> >> never
    >> >> appears. Do i need some codebehind code to switch from advertisings or
    >> >> it
    >> >> must happen automatically?
    >> >>
    >> >> Thanks
    >> >> Dan
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
    Dan, May 22, 2007
    #5
  6. That's correct. The AdRotator is designed to pull one item at random from
    the datasource. It doesn't pull them all and then iterate through them
    client-side. There are third-party rotator controls that can do it.
    r.a.d.Rotator from www.telerik.com is an excellent control that can work
    this client-side.


    --
    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006

    "Dan" <> wrote in message
    news:%23Fr%...
    > Hi Milosz,
    >
    > thanks for replying .. but i think there is a little misunderstanding ...
    > When i refresh my page, the advertising also changes.That's not the
    > problem.
    > I thought the advertising would change by itself automatically.
    > Is it wrong and must the page each time be refreshed for switching between
    > advertisings?
    >
    >
    > "Milosz Skalecki [MCAD]" <> schreef in bericht
    > news:...
    >> Howdy,
    >>
    >> <Advertisements
    >> xmlns="http://schemas.microsoft.com/AspNet/AdRotator-Advertisement-File-1.2">
    >> <Ad>
    >> <ImageUrl>~/Images/pic1.png</ImageUrl>
    >> <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    >> <AlternateText>Coca Cola</AlternateText>
    >> <Keyword>coca</Keyword>
    >> <Impressions>50</Impressions>
    >> </Ad>
    >> <Ad>
    >> <ImageUrl>~/Images/pic2.png</ImageUrl>
    >> <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    >> <AlternateText>Alfa Romeo</AlternateText>
    >> <Keyword>alfa</Keyword>
    >> <Impressions>50</Impressions>
    >> </Ad>
    >> </Advertisements>
    >>
    >> It should work, try to refresh the page few times and see if the image
    >> changes.
    >>
    >> hope this helps
    >>
    >> --
    >> Milosz
    >>
    >>
    >> "Dan" wrote:
    >>
    >>> Hi,
    >>>
    >>> I created an AdRotator control with this code:
    >>> <asp:AdRotator id="AdRotator1"
    >>> Runat="Server" AdvertisementFile="adrotator.xml">
    >>> </asp:AdRotator>
    >>>
    >>> The xml file contains:
    >>> <Advertisements>
    >>> <Ad>
    >>> <ImageUrl>images/pic1.png</ImageUrl>
    >>> <NavigateUrl>http://www.cocacola.us</NavigateUrl>
    >>> <AlternateText>Coca Cola</AlternateText>
    >>> <Keyword>coca</Keyword>
    >>> <Impressions>50</Impressions>
    >>> </Ad>
    >>> <Ad>
    >>> <ImageUrl>images/pic2png</ImageUrl>
    >>> <NavigateUrl>http://www.alfaromeo.us</NavigateUrl>
    >>> <AlternateText>Alfa Romeo</AlternateText>
    >>> <Keyword>alfa</Keyword>
    >>> <Impressions>50</Impressions>
    >>> </Ad>
    >>> </Advertisements>
    >>>
    >>> When running, i see the first advertising, but the second advertising
    >>> never
    >>> appears. Do i need some codebehind code to switch from advertisings or
    >>> it
    >>> must happen automatically?
    >>>
    >>> Thanks
    >>> Dan
    >>>
    >>>
    >>>

    >
    >
    Mark Fitzpatrick, May 23, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DDK

    Adrotator and flash banner?

    DDK, Jun 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    3,277
    akino
    Oct 25, 2007
  2. C Downey

    AdRotator

    C Downey, Jun 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    381
    Trevor Benedict R
    Jun 17, 2004
  3. Leon
    Replies:
    2
    Views:
    665
    Andy Lim
    Nov 15, 2004
  4. DC
    Replies:
    0
    Views:
    489
  5. Dan

    question about AdRotator

    Dan, May 22, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    502
    Mark Fitzpatrick
    May 23, 2007
Loading...

Share This Page