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

RadRotator in User Control Not displaying

3 Answers 153 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Colin Armstrong
Top achievements
Rank 1
Colin Armstrong asked on 05 Oct 2010, 09:48 AM
Can you Help?

The Radrotator displays prefectly when running the website locally using Visual Studio 2010 but as soon as I upload the website to my webspace the Radroator within the usercontrol doesn't show. I've tested the usercontrol displays by just adding some random text, so I must be missing something with the Rotator somewhere.

Has anyone got any ideas what the problem might be? What am I missing chaps?:

Rotator.ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Rotator.ascx.vb" Inherits="Controls_Rotator" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
                   <telerik:RadRotator ID="RadRotator1" runat="server" Width="300px" Height="600px" ScrollDuration="5000" FrameDuration="5000"
                    ItemWidth="300" ScrollDirection="Down" ItemHeight="300">
                    <ItemTemplate>
                        <div class="itemTemplate">sadasdsasadsadadsa
                            <img src='<%# Page.ResolveUrl("~/Pictures/") + Container.DataItem %>.jpg' alt="Customer Image" />
                        </div>
                    </ItemTemplate>
                </telerik:RadRotator>
             </telerik:RadAjaxPanel>


************
Rotator.ascx.vb

Partial Class Controls_Rotator

    Inherits System.Web.UI.UserControl
    Private Property clients As String()
    Private Property document As Object

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RadRotator1.DataSource = GetRotatorDataSource()
        RadRotator1.DataBind()
    End Sub

    Private Function GetRotatorDataSource() As String()
        Dim Currentpage As String
        Currentpage = System.IO.Path.GetFileName(Request.Url.ToString())
        If Currentpage = "New_Builds.aspx" Then
            ' MsgBox("heloo")
            Dim clients As String() = {"new_1", "new_2", "new_3", "new_4"}
            Return clients
        ElseIf Currentpage = "Landscaping.aspx" Then
            Dim clients As String() = {"land_1", "land_2", "land_3", "land_4", "land_5"}
            Return clients
        ElseIf Currentpage = "Renovations-Extensions.aspx" Then
            Dim clients As String() = {"ren_1", "ren_2", "ren_3", "ren_4", "ren_5", "ren_6"}

            Return clients
        End If
        Return clients
    End Function
End Class

ASPX Page

%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="New_Builds.aspx.vb" Inherits="Pages_New_Builds" %>

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

<%@ Register src="../Controls/Rotator.ascx" tagname="Rotator" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
   
    <div class="ex">
    
        <uc1:Rotator ID="Rotator1" runat="server" />
    
    </div>


3 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 08 Oct 2010, 07:39 AM
Hello Colin,

Could you please check whether the GetRotatorDataSource method return some data when it is running on the server? I guess that all checks in that method (like If Currentpage = "New_Builds.aspx" Then ...) fail and this cause the behavior on your  side.

Kind regards,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Amit
Top achievements
Rank 1
answered on 26 Dec 2010, 11:39 AM
I am also facing similar issue , when i use RadRotator on user contol , it doesnt display , while same thing works fine on a .aspx page.
I too have cross checked the datasource and for sample i have taken image path. 

I am not sure if i am missing something or RadRotator doesnt work on user controls ...  
Please provide your valuable inputs.... 
0
Fiko
Telerik team
answered on 29 Dec 2010, 02:21 PM
Hello Colin,

All RadRotator;s features can be used in any UserControl (or MasterPage) scenarios. For your convenience I have attached a fully working demo to this thread.

Greetings,
Fiko
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Rotator
Asked by
Colin Armstrong
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Amit
Top achievements
Rank 1
Share this question
or