Problem with Xml As Data Sources for the RadRotator

3 posts, 0 answers
  1. Praneetha Vegasina
    Praneetha Vegasina avatar
    2 posts
    Member since:
    Nov 2009

    Posted 19 Nov 2009 Link to this post

    Hi ,

    I am new to telerik , Here the code from where i used Xml as Datasource for the Rotator, It bind the Images to rotator but those are not rotating the images are static...........

    User Control Page

    <%

    @ Control Language="C#" AutoEventWireup="true" CodeFile="rotator.ascx.cs" Inherits="layout_controls_rotator" %>

     

    <%

    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

    <

     

    telerik:RadScriptManager ID="RadScriptManager1" runat="server">

     

    </

     

    telerik:RadScriptManager>

     

     

    <telerik:RadRotator ID="RadRotator1" Width="328px" Height="120px" ScrollDirection="Up" ScrollDuration="600" FrameDuration="6000" ItemHeight="118" ItemWidth="108" DataSourceID="XmlDataSource1" runat ="server">

     

     

    <ItemTemplate>

     

     

    <img src='<%# XPath("Link")%>' alt = '<%# XPath("title")%>'/>

     

     

    </ItemTemplate>

     

     

    </telerik:RadRotator>

     

    <

     

    asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/Rotator.xml"></asp:XmlDataSource>



    ASPX page

     

    <%

    @ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="layout_controls_Test" %>

     

    <%

    @ Register Src="rotator.ascx" TagName="rotator" TagPrefix="uc1" %>

     

    <!

     

    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

     

    <

     

    html xmlns="http://www.w3.org/1999/xhtml" >

     

    <

     

    head runat="server">

     

     

    <title>Rotator</title>

     

    </

     

    head>

     

    <

     

    body>

     

     

    <form id="form1" runat="server">

     

     

    &nbsp;

     

     

    <uc1:rotator ID="Rotator1" runat="server" />

     

     

     

    </form>

     

    </

     

    body>

     

    </

     

    html>

    XML File

     


    <?

     

    xml version="1.0" encoding="utf-8" ?>

     

    <

     

    RoatatorItems>

     

    <

     

    item>

     

    <

     

    title>This is a test 1</title>

     

    <

     

    Link>C:\Documents and Settings\My Documents\My Pictures\Office1.jpg</Link>

     

    </

     

    item>

     

    <

     

    item>

     

    <

     

    title>This is a test 2</title>

     

    <

     

    Link>C:\Documents and Settings\My Documents\My Pictures\Office2.jpg</Link>

     

    </

     

    item>

     

    <

     

    item>

     

    <

     

    title>This is a test 3</title>

     

    <

     

    Link>C:\Documents and Settings\My Documents\My Pictures\Office3.jpg</Link>

     

    </

     

    item>

     

    </

     

    RoatatorItems>

     


  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 23 Nov 2009 Link to this post

    Hi Praneetha,

    The behavior that you experience is the expected one. In your case you need to set the size properties of the RadRotator control according to the size of the items in the ItemTemplate. More details about the configuration of the control can be found in this forum thread.
    Additionally, I see that you use physical paths (C:\Path). Please note that this approach will not work with any images declared on your page. You need to set a valid virtual path to the images or an absolute path instead.

    I hope this helps.

    Best wishes,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Praneetha Vegasina
    Praneetha Vegasina avatar
    2 posts
    Member since:
    Nov 2009

    Posted 23 Nov 2009 Link to this post

    Thank you for the information , I got it.
Back to Top