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

Controls collection cannot be modified error...

1 Answer 10 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Ken asked on 17 Nov 2008, 06:50 AM

So, I've seen a number of posts related to this and all of them seemed to be related to control blocks added to JS inside of controls...but, that's not my problem. For whatever reason, control blocks in unrelated non-server-side div tags seem to be causing the same error. See the code below. If I remove the <div> tags with the resource pulls, it works. If I remove the RadAjaxManager or if I switch the string drops into Literals, the error goes away. What's up with that? Those divs aren't being run at the server side so they shouldn't be included as controls.

This is with your 2008 AJAX grid control running on .Net 3.5 SP1, VS 2k5 using the built-in dev server.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="imATHLETE.account.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<html xmlns="" >
<head runat="server">
    <title>Untitled Page</title>
 <form id="whatever" runat="server">
 <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">

   <asp:SqlDataSource ID="imATHLETEDBNet" runat="server" ConnectionString="<%$ ConnectionStrings:imATHLETEDBNet %>"
     SelectCommand="usp_get_EventParticipantList" SelectCommandType="StoredProcedure">
      <asp:QueryStringParameter DefaultValue="0" Name="inEventID" QueryStringField="fEventDisplayID"
       Type="Int32" />
      <asp:Parameter Name="inUserID" Type="Int32" DefaultValue="1043" />
      <asp:Parameter DefaultValue="0" Name="inFormatXML" Type="Int16" />
 <div class="PageHeader">
   <%=Resources.Strings_EN_US.RDPartiDetailsPageTitle %>
   <span style="color: #CCCCCC;">&nbsp;&gt;&nbsp;<%=Resources.Strings_EN_US.RDPartiDetailsPageTitle2 %></span>
  <div id="ParticipantDetails_EventSelect">
   <h3><%=Resources.Strings_EN_US.RDPartiDetailsSelectEvent %></h3>
   <select name="fEventDisplayID" id="fEventDisplayID">
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
   <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" DataSourceID="imATHLETEDBNet" GridLines="None" Skin="Outlook" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
     <HeaderContextMenu EnableTheming="True" Skin="Outlook">
      <CollapseAnimation Duration="200" Type="OutQuint" />
     <MasterTableView AutoGenerateColumns="False" DataSourceID="imATHLETEDBNet">
       <HeaderStyle Width="20px" />
       <HeaderStyle Width="20px" />
       <telerik:GridBoundColumn DataField="XML_F52E2B61-18A1-11d1-B105-00805F49916B" HeaderText="XML_F52E2B61-18A1-11d1-B105-00805F49916B"
        ReadOnly="True" SortExpression="XML_F52E2B61-18A1-11d1-B105-00805F49916B" UniqueName="XML_F52E2B61-18A1-11d1-B105-00805F49916B">
     <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
      <Selecting AllowRowSelect="True" />
      <Scrolling AllowScroll="True" UseStaticHeaders="True" />
     <FilterMenu EnableTheming="True" Skin="Outlook">
      <CollapseAnimation Duration="200" Type="OutQuint" />
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <telerik:AjaxSetting AjaxControlID="RadGrid1">
      <telerik:AjaxUpdatedControl ControlID="RadGrid1" />





1 Answer, 1 is accepted

Sort by
Telerik team
answered on 17 Nov 2008, 07:51 AM
Hello Ken,

You can wrap these divs with RadCodeBlock to avoid the error.

the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question