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

Rotator only showing first image on XML file

1 Answer 47 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Tania
Top achievements
Rank 1
Tania asked on 04 Dec 2008, 07:54 PM
I have a rotator that used to work before I upgraded to Q32008.
It only rotates first image.

here is the code:

 

 

 

<telerik:RadRotator ID="RadRotator1"

 

 

                    runat="server"

 

 

                    DataSourceID="XmlDataSource1"

 

 

                    Skin="Web20"

 

 

                    FrameDuration="6000"

 

 

                    Height="300px"

 

 

                    ScrollDuration="600"

 

 

                    Width="650px" >

 

 

 

 

 

 

        <ItemTemplate>

 

 

 

                    <img alt="<%# XPath("/Files/item/title") %>" src="Images/<%# XPath("/Files/item/filename") %> " />

 

 

        </ItemTemplate>

 

 

 

 

 

 

</telerik:RadRotator>

 

 

 

 

 

 

<asp:XmlDataSource ID="XmlDataSource1" runat="server"

 

 

DataFile="~/App_Data/ImageRotator.xml" >

 

 

</asp:XmlDataSource>

 

my xml file looks like this

 

 

 


 

<?

 

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

 

<

 

Files>

 

<

 

item>

 

<

 

filename>2008.jpg</filename>

 

<

 

title>2008 Text</title>

 

</

 

item>

 

<

 

item>

 

<

 

filename>banner4.jpg</filename>

 

<title>banner Text</title></

 

item>

 

<

 

item>

 

<

 

filename>04.png</filename>

 

<title>04 Text</title>
</

 

item>

 

</

 

Files>

 

can somebody give me a hint on what am I missing?

 

 

 

 

 


thanks

 

1 Answer, 1 is accepted

Sort by
0
Tania
Top achievements
Rank 1
answered on 05 Dec 2008, 01:41 PM
I got it.
I changed the XPath expresion to <img alt="<%# XPath("title") %>" src="Images/<%# XPath("filename")
Thanks
Tags
Rotator
Asked by
Tania
Top achievements
Rank 1
Answers by
Tania
Top achievements
Rank 1
Share this question
or