Using a SQL-Datasource to populate the Rotator

2 posts, 0 answers
  1. Peter Ivanov
    Peter Ivanov avatar
    6 posts
    Member since:
    Oct 2009

    Posted 18 Nov 2009 Link to this post

    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.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Nov 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top