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

[Solved] RadAjaxManager issue

2 Answers 169 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Maxim
Top achievements
Rank 1
Maxim asked on 19 Jan 2008, 09:18 PM
I'm getting this error while using RadAjaxManager.
"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."
To reproduce. Create a master file and then add a default page inheriting master file. See contents below.
Here is sample ASPX file

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTextBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTextBox2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <rad:RadTextBox ID="RadTextBox1" runat="server">
    </rad:RadTextBox>
    <rad:RadTextBox ID="RadTextBox2" runat="server">
    </rad:RadTextBox>
    <script type="text/javascript">
        var cID = "<%=RadTextBox1.ClientID %>";
    </script>
</asp:Content>

2 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 21 Jan 2008, 06:54 AM
Hi Maxim,

Indeed, the error will appear when you add server-side code blocks inside the markup. You can wrap the script within RadCodeBlock as suggested in Prometheus docs here.

Should you need further assistance, please get back to us.

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Maxim
Top achievements
Rank 1
answered on 22 Jan 2008, 02:59 PM
I should have read documentation more carefully.
Thank you for your help.
Tags
Ajax
Asked by
Maxim
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Maxim
Top achievements
Rank 1
Share this question
or