Hello ,
i am using a radRotator emedded in webpart the rotator works fine in asp web application , but when i use my web part the rotator didn't works fine . it didn't rotate to all item it just display the item no 2 then the rotator rotate to an empty item .and stop and nothing else occures ,
here is rotator
<% @ Control Language="C#" AutoEventWireup="true" Inherits="SACMSharePointWebPart.uc_FastTickerNews" %>
<% @ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2009.1.402.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %> <telerik:RadRotator ID="NewsRotator" RotatorType="AutomaticAdvance" ScrollDirection="Up" |
SlideShowAnimation-Type="Fade" ScrollDuration="200" runat="server" Width="100%" |
FrameDuration="6000" ItemHeight="30px" ItemWidth="100%" Height="30px" InitialItemIndex="0" |
Skin="Vista"> |
<ItemTemplate> |
<table style="text-align: right;"> |
<tr style="height: 30px;"> |
<td> |
<div style="width: 100%; filter: alpha(opacity=90); font-weight: bold; font-family: Tahoma; |
background-color: #fff"> |
<%# Eval("Location") %> |
: </div> |
</td> |
<td style="padding-left: 10px"> |
<div style="width: 100%; filter: alpha(opacity=90); font-family: Tahoma; |
background-color: #fff"> |
<telerik:RadTicker ID="RadTicker1" runat="server"> |
<Items> |
<telerik:RadTickerItem Text='<%# Eval("Title") %>' /> |
</Items> |
</telerik:RadTicker> |
</div> |
</td> |
</tr> |
</table> |
</ItemTemplate> |
</telerik:RadRotator> |
and the rotator code behind
public class uc_FastTickerNews : UserControl |
{ |
public RadRotator NewsRotator |
{ |
get |
{ |
return this.FindControl("NewsRotator") as RadRotator; |
} |
} |
/// <summary> |
/// Handles the Load event of the Page control. |
/// </summary> |
/// <param name="sender">The source of the event.</param> |
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> |
protected void Page_Load(object sender, EventArgs e) |
{ |
List<TickerNewsContainer> lst = new List<TickerNewsContainer>(); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 1" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 2 " }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "3 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION4 " }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "5 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "6 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION7 " }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "8 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "9 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "10 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 11" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 12 " }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "13 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION14 " }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "15 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "16 LOCATION" }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION17 " }); |
lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "18 LOCATION" }); |
this.NewsRotator.DataSource = lst; |
this.NewsRotator.DataBind(); |
} |
} |
alse here is the web part code
[ Guid("d879501c-6386-4646-bd57-cd012ca9f6e6")]
public class SACMFastTickerNews : System.Web.UI.WebControls.WebParts.WebPart
{
public uc_FastTickerNews FastTickerNews { get; set; }
{ } protected override void CreateChildControls() |
{ |
base.CreateChildControls(); |
this.FastTickerNews = (uc_FastTickerNews)Page.LoadControl("~/_controltemplates/uc_FastTickerNews.ascx"); |
this.Controls.Add(this.FastTickerNews); |
} |
#region Events & Fixers |
protected override void OnInit(EventArgs e) |
{ |
base.OnInit(e); |
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page); |
if (scriptManager == null) |
{ |
scriptManager = new ScriptManager(); |
if (this.Page.Form.FindControl("ScriptManager1") == null) |
{ |
scriptManager.ID = "ScriptManager1"; |
this.Page.Form.Controls.AddAt(0, scriptManager); |
} |
} |
return scriptManager; |
} |
#endregion } |
please help me :)