Link to home
Start Free TrialLog in
Avatar of Vincent Stack
Vincent StackFlag for Qatar

asked on

ASP.Net 2.0 AdRotator won't rotate

Hello, I have an adrotator componet (asp.net 2.0) connected to a sqldatasource that collects the ad information.  I was under the assumption (obviously wrong) that the adrotator would magically rotate through the recordset.

Is there another setting or something that motivates the adrotator to move to the next ad.  If not, do I write a sub?

Here's my adrotator:

  <asp:AdRotator ID="AdRotator1" runat="server" DataSourceID="SqlDataSourceAdRotator" Width="100px"
          OnAdCreated="CreateNewAd" />
Avatar of strickdd
strickdd
Flag of United States of America image

I would look at the DB structure and make sure that is matched below:

    * An int primary key, which can be called anything you like
    * an nvarchar field called ImageURL that has a relative or absolute URL pointing to the image to be displayed
    * an nvarchar field called NavigateURL that has a relative or absolute URL that the image is hyperlinked to. If you leave the contents of this field blank, theres no hyperlink from the image.
    * an nvarchar field called AlternateText containing a string that will be inserted into the <IMG> tags ALT attribute (and will, therefore, depending on the viewing browsers capabilities or preferences, be displayed as a tooltip, or instead of the image or be read aloud to the user etc). By the way, is it just me, or should this be called "AlternativeText"?

pulled from http://blogs.msdn.com/acoat/archive/2005/11/07/AdRotator-Dynamic-Image-Generation.aspx
Avatar of Vincent Stack

ASKER

Hi,
Maybe I misunderstand what this component does.  I was expecting it to cycle through the ads while the page sits (like an animated gif - ) but does it simply display a different ad everytimme the page is visited?
I know you can weight how often each ad is displayed.

I have the following table

CREATE TABLE [dbo].[tblAdRotatorSponsors](
      [AdID] [int] IDENTITY(1,1) NOT NULL,
      [AlternateText] [varchar](100) COLLATE Latin1_General_CI_AS NULL,
      [ImageUrl] [varchar](100) COLLATE Latin1_General_CI_AS NULL,
      [NavigateUrl] [varchar](200) COLLATE Latin1_General_CI_AS NULL,
 CONSTRAINT [PK_tblAdRotatorSponsors] PRIMARY KEY CLUSTERED
(
      [AdID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
ASKER CERTIFIED SOLUTION
Avatar of S31B1
S31B1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, I use Visual Studio Express.  Is there a timer component and update panel available?

I see this as a possible solution but what about the performance hit every time the db is called?

By the way, I will issue you the points for this.  Thanks for setting me straight.
Avatar of S31B1
S31B1

I couldn't say if one is available for VS express. However I assume that if you install the MS AJAX librarys you may find you get these controls.

Yes there is a performace hit, this is a very simplistic solution. If I was to expect very high volumes of traffic I would code the control from the ground up using core ajax technologys instead of the UpdatePanel control.
Thanks.