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

Rotator displays in IE but nothing else

1 Answer 30 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Hefin Jones
Top achievements
Rank 1
Hefin Jones asked on 17 Nov 2009, 05:02 PM

Hello!

We have created a simple web user control which contains a radrotator control that uses an XML file as its datasource.  This works fine in IE but when we try to view the page in any other browse (Firefox, Chrome, Opera etc) the page just displays a blank section where the rotator should appear. 

The user control is embedded within a page layout file using:

<%@ Register Src="/WebControls/NewsRotator.ascx" TagName="NewsRotator" TagPrefix="CCCControls" %>

<CCCControls:NewsRotator ID="NewsRotator1" runat="server"/>

The code for the user control is:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="NewsRotator.ascx.vb" Inherits="NewsRotator" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
            <telerik:RadRotator width="100%" Height="180px" ItemHeight="200px" PauseOnMouseOver="false" ItemWidth="100%" FrameDuration="4000" ID="Rotator1" runat="server" ScrollDirection="Up">
                <ItemTemplate>
                    <div class="NewsRotatorContainer">
                        <div class="NewsRotatorHeader"><h2><%# XPath("Title") %></h2></div>
                            <div class="NewsRotatorImages">
                                <img src="<%# XPath("Image") %>" height="127" width="200" alt="" title="" style="border: 0px" />
                            </div>
                            <div class="NewsRotatorContent">
                                <%# XPath("Content") %>
                                <br /><br />
                                <a href="<%# XPath("URL") %>" class="orderInfo">Read more&nbsp;&raquo;</a>
                            </div>
                    </div>
                </ItemTemplate>
            </telerik:RadRotator>

With a code behind file with the following code:

Partial Class NewsRotator
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim newsSource As New XmlDataSource()
        newsSource.DataFile = "/WebControls/Rotator.xml"
        If InStr(UCase(Request.Url.ToString()), "CYMRAEG") > 0 Then
            newsSource.XPath = "NewsItems/Language[@name ='cymraeg']/NewsItem"
        Else
            newsSource.XPath = "NewsItems/Language[@name ='english']/NewsItem"
        End If
        Me.Rotator1.DataSource = newsSource
        Me.Rotator1.DataBind()
    End Sub
End Class

Any ideas why the control is displaying blank in any other browser other that IE??

Cheers!

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 20 Nov 2009, 07:25 AM
Hello Hefin,

The RadRotator control, does not support values in percent and you need to use fixed values in its declaration. This restriction is by design, because the rotator control needs to know the Items' size, when it is loaded, in order to determine where an item starts or ends. In the RadRotator's declaration I suggest you specify all of the following properties: Width, ItemWidth, Height, ItemHeight (in pixels). Those properties are important and you need them in order to make the RadRotator control works properly.

I hope this helps.

Regards,
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.
Tags
Rotator
Asked by
Hefin Jones
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or