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

Rotator, LINQ data and AJAX Loading Panel

1 Answer 72 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Ivan asked on 03 Sep 2010, 12:00 AM

Hello everyone.

I'm using a Window on my page that has a Rotator in it. The Rotator is bound to a LINQ data set. It worked fine,
but then I tried to put an AJAX Loading Panel to show a "loading" image while the rotator is bound and I get the following error:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

I tried using a RadCodeBlock without luck.

Here is my code:

(Main .aspx page)

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function openWin()
            var oWnd = radopen("SCARLog.aspx", "RadWindow1");

<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
ReloadOnShow="true" runat="server" Skin="Hay" EnableShadow="true">
        <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Close" NavigateUrl="Log.aspx">

(.aspx window page)
<body height="100%" scroll="no" style="overflow:hidden;" scrooltop="oTop" >
<title>Detail Log</title>

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

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <telerik:AjaxSetting AjaxControlID="Panel1">
                <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />

<telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" Skin="Hay" />

<asp:Panel ID="Panel1" runat="server" HorizontalAlign="Center" Height="275px">
<telerik:RadRotator ID="Rotator" runat="server" Skin="Hay" ScrollDirection="Up"
RotatorType="AutomaticAdvance" FrameDuration="3000" Width="300px" ItemWidth="302px" Height="100px" ItemHeight="100px">
    <div style="text-align:center">
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <asp:Label ID="lblDate" runat="server">Date: <%# DataBinder.Eval(Container.DataItem,"DateChanged") %></asp:Label>
    <div style="text-align:center">
        <asp:Label ID="Label2" runat="server">User ID: </asp:Label>
        <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
            <asp:Label ID="lblUser" runat="server"><%# DataBinder.Eval(Container.DataItem, "UserID")%></asp:Label>
    <div style="text-align:center">
        <asp:Label ID="Label3" runat="server">From status: </asp:Label>
        <telerik:RadCodeBlock ID="RadCodeBlock3" runat="server">
            <asp:Label ID="lblFrom" runat="server"><%# DataBinder.Eval(Container.DataItem, "FromStatus")%></asp:Label>
    <div style="text-align:center">
        <asp:Label ID="Label4" runat="server">To status: </asp:Label>
        <telerik:RadCodeBlock ID="RadCodeBlock4" runat="server">
            <asp:Label ID="lblTo" runat="server"><%# DataBinder.Eval(Container.DataItem, "ToStatus")%></asp:Label>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="Center" EnableSkinTransparency="true">
    <asp:Image id="Image1" runat="server" ImageUrl="~/images/Loading.gif" ></asp:Image>



(.aspx.cs code)

if (!this.IsPostBack)
    Int32 Snum = Convert.ToInt32(Session["IDNumber"].ToString());
    using (Entity db = new Entity())
        var data = from L in db.Log
        where L.IDNumber == Snum
        orderby L.DateChanged
        select new
        Rotator.DataSource = data;

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 08 Sep 2010, 12:10 PM
Hello Ivan,

Could you please try using RadWindows Content container, as shown in the following online demo:

Kind regards,
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
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question