This is a migrated thread and some comments may be shown as answers.

Using a SQL-Datasource to populate the Rotator

1 Answer 83 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Peter Ivanov
Top achievements
Rank 2
Peter Ivanov asked on 18 Nov 2009, 11:42 AM
Hi,

I'm having a problem populating my Rad Rotator using the traditional way of using a datasource in the ASP side of the code, this is what my code looks like.

<telerik:RadRotator runat="server" ID="RadRotator1" RotatorType="AutomaticAdvance" ScrollDirection="Up" FrameDuration="7000" 
        DataSourceID="SqlDataSource1">  
    <Items> 
        <telerik:RadRotatorItem> 
            <ItemTemplate> 
                <asp:Image ID="imgAdBanner" runat="server" ImageUrl='<%# "~/ImageFilePath/" & Eval("ImageName") %>' 
                        
NavigateUrl='<%# Eval("LinkUrl") %>'  AlternateText='<%# Eval("AltText") %>' />
                        
            </ItemTemplate> 
        </telerik:RadRotatorItem> 
    </Items> 
</telerik:RadRotator> 
 
<asp:SqlDataSource runat="server" ID="SqlDataSource1" 
    ConnectionString="<%$ ConnectionStrings : CS %>" 
    SelectCommand="SELECT ImageName, LinkUrl, AltText FROM RotatorImages">  
</asp:SqlDataSource> 

Any advice will be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Nov 2009, 12:21 PM
Hai Peter,

From the above code, I can see that you have not set the DataSourceID properly as SqlDataSource's. Try changing that and see whether it is working fine as expected.
Also checkout the following links to know more on binding RadRotator to ASP DataSource components.
demo
Documentation

hope this helps,
Shinu.
Tags
Rotator
Asked by
Peter Ivanov
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or