Using images in Phots for an adrotator control

Last post 05-16-2008 3:45 AM by samir1973. 8 replies.

Sort Posts:

  • Using images in Phots for an adrotator control

    01-07-2007, 8:39 PM
    • Loading...
    • dbs253
    • Joined on 11-09-2006, 10:26 PM
    • Posts 8

    Lets assume that on the front page of my club website I want to have an adrotator that rotates through the different pictures that appear in the Photos section.

    From what I understand, the adrotator will get its information from either an xml file, or from a table that follows a particular schema.

    I have created a table in my SQL Server database to hold the information, according to specifications, but do not know how to set the ImageUrl field, since the image is in the images table and not physically on the server's file system.

     Any suggestion will be appreciated!

     

    Dabas
    Filed under:
  • Re: Using images in Phots for an adrotator control

    01-08-2007, 4:44 PM
    • Loading...
    • dbs253
    • Joined on 11-09-2006, 10:26 PM
    • Posts 8

    I have solved the problem:

    I created this table as my DataSource: Works well! Let me know if it helps you too!

    CREATE

    TABLE [dbo].[AdRotatorData](

    [ID] [int]

    IDENTITY(1,1) NOT NULL,

    [ImageUrl]

    AS ('imagefetch.ashx?size=0&imageid='+ltrim(str([imageid]))),

    [NavigateUrl]

    AS ('Info.aspx?imageid='+ltrim(str([imageid]))),

    [AlternateText] [varchar]

    (35) COLLATE Latin1_General_CI_AS NULL CONSTRAINT [DF_AdRotatorData_AlternateText] DEFAULT (N'Click Here to view this image'),

    [Keyword] [varchar]

    (50) COLLATE Latin1_General_CI_AS NULL,

    [Impressions] [int]

    NULL CONSTRAINT [DF_AdRotatorData_Impressions] DEFAULT ((1)),

    [Width] [int]

    NULL CONSTRAINT [DF_AdRotatorData_Width] DEFAULT ((470)),

    [Height] [int]

    NULL CONSTRAINT [DF_AdRotatorData_Height] DEFAULT ((353)),

    [imageid] [int]

    NULL

    )

    ON [PRIMARY]

     

    Dabas
  • Re: Using images in Phots for an adrotator control

    06-09-2007, 11:24 AM

    Great!

    It works!

  • Re: Using images in Phots for an adrotator control

    06-09-2007, 1:02 PM
    • Loading...
    • dbs253
    • Joined on 11-09-2006, 10:26 PM
    • Posts 8

    WOW! I had forgotten that I had posted my solution.

    I am glad it helped somebody else too!

     

    Dabas
  • Re: Using images in Phots for an adrotator control

    06-16-2007, 11:26 AM
    • Loading...
    • dips
    • Joined on 04-27-2007, 11:16 AM
    • London
    • Posts 18

    Hi,

    I hope you can help me im using the club starter kit which is working really good but i just need to add one little function to it.  The photo section you can use the next button or the previous button to see the images, i want to add another button so it will play all the images in that abum like a slide show, so you dont have to keep pressing the button, can anyone help me please...

     

    Dips
     

  • Re: Using images in Phots for an adrotator control

    06-16-2007, 7:28 PM
    • Loading...
    • dbs253
    • Joined on 11-09-2006, 10:26 PM
    • Posts 8

    Hi dips:

     By coincidence, yesterday I was afters something very similar to what you want, and I found this codeproject contribution, that does what you want:

     http://www.codeproject.com/aspnet/CatalogViewPhotoGallery.asp

     

    Dabas
  • Re: Using images in Phots for an adrotator control

    05-15-2008, 10:16 AM
    • Loading...
    • samir1973
    • Joined on 04-15-2008, 12:56 AM
    • Posts 22

    dear DBS253

    will you please post the complete solution how u have connected with front end asp.net

    also will u pls post me the sample data thru select command as am struggling to insert data

    just show me the data thru "select * from AdRotatorData"

    thanx a lot

    samir

     

  • Re: Using images in Phots for an adrotator control

    05-15-2008, 4:50 PM
    • Loading...
    • dbs253
    • Joined on 11-09-2006, 10:26 PM
    • Posts 8

    <asp:SqlDataSource ID="SqlDataRotator" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"

    SelectCommand="SELECT ImageUrl, NavigateUrl, AlternateText, Keyword, Impressions, Width, Height, imageid FROM vwAdRotatorData">

    </asp:SqlDataSource>

    Dabas
  • Re: Using images in Phots for an adrotator control

    05-16-2008, 3:45 AM
    • Loading...
    • samir1973
    • Joined on 04-15-2008, 12:56 AM
    • Posts 22

    dear dabas

    thanx for your reply but with this table script am unable to understood the following as till now am managing with XML this adrotator but its very difficult to modify for new ads hence am trying to convert my project with database.

    pls clear me the doubts for the following 3 lines

    1) for ImageUrl and NavigateUrl what will be data type. Here your data type I have not understood

    2) also have noticed that u have assigned one imageid and referring into ImageUrl n NavigateUrl.

    Please help me the following 2

    [ImageUrl] AS ('imagefetch.ashx?size=0&imageid='+ltrim(str([imageid]))), [NavigateUrl] AS ('Info.aspx?imageid='+ltrim(str([imageid]))), [imageid] [int] NULL

     

    for xml am doing this 2 like the following way

    <ImageUrl>1.JPG</ImageUrl>
    <NavigateUrl>http://www.microsoft.com</NavigateUrl>

     

Page 1 of 1 (9 items)