Hi,
which gives the same error..
I have upgraded RADControls - RADTreeView from ASP.NET to ASP.NET AJAX v2009.1.527.35.
I get the error "controls collection cannot be modified" when the page loads.
The RADControl declaration and associated code is given below.
<telerik:RadTreeView id="AllControlsTree" Runat="server" Width="99%" OnContextMenuItemClick="Tree_ContextMenuItemClick" | |
OnClientContextMenuItemClicking="BeforeClientContextHandler" Height="60%"></telerik:RadTreeView> | |
<TABLE cellSpacing="2" cellPadding="0" width="260"> | |
<TR> | |
<TD onclick="AddControlsPostBack(<%= AllControlsTree.ClientID %>);" >Cell xxx | |
Add Controls To Version | |
</TD> | |
</TR> | |
</TABLE> | |
Already tried
<telerik:RadTreeView id="AllControlsTree" Runat="server" Width="99%" OnContextMenuItemClick="Tree_ContextMenuItemClick" | |
OnClientContextMenuItemClicking="BeforeClientContextHandler" Height="60%"></telerik:RadTreeView> | |
<TABLE cellSpacing="2" cellPadding="0" width="260"> | |
<TR> | |
<TD onclick="AddControlsPostBack($find('<%= AllControlsTree.ClientID %>')" >Cell xxx | |
Add Controls To Version | |
</TD> | |
</TR> | |
</TABLE> | |
Regards...
3 Answers, 1 is accepted
0
Hi Andy Hooper,
Could you please paste the whole page? I couldn't reproduce the error using your markup in a new page.
This error occurs when you are using <%= %> inside <script > tags. If this is the case wrap the <script> tag with the <telerik:RadScriptBlock> control. Here is an example:
<telerik:RadScriptBlock runat="server" id="RadScriptBlock1">
<script type="text/javascript">
//some JavaScript code here.
</script>
</telerik:RadScriptBlock>
Regards,
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Could you please paste the whole page? I couldn't reproduce the error using your markup in a new page.
This error occurs when you are using <%= %> inside <script > tags. If this is the case wrap the <script> tag with the <telerik:RadScriptBlock> control. Here is an example:
<telerik:RadScriptBlock runat="server" id="RadScriptBlock1">
<script type="text/javascript">
//some JavaScript code here.
</script>
</telerik:RadScriptBlock>
Regards,
Albert
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Paul
Top achievements
Rank 1
answered on 07 Sep 2009, 07:40 PM
Hi Albert,
here is a page code for the issue.
<%@ Page Language="vb" AutoEventWireup="false" Theme="NewWindow" %> | |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<HTML style="MARGIN: 0px; WIDTH: 100%; HEIGHT: 100%"> | |
<HEAD runat="server"> | |
<title>MasterPlan Amendments Module</title> | |
<LINK href="../../MasterView.css" type="text/css" rel="stylesheet"> | |
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"> | |
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE"> | |
<meta content="JavaScript" name="vs_defaultClientScript"> | |
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"> | |
</HEAD> | |
<body style="MARGIN: 0px; WIDTH: 100%"> | |
<form id="frmAmendments" style="MARGIN: 0px; WIDTH: 100%; HEIGHT: 100%" method="post" runat="server"> | |
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> | |
<script language="javascript"> | |
function refreshGrid() | |
{ | |
//alert('hello'); | |
window["<%=EventsGrid.ClientID %>"].AjaxRequest('<%= EventsGrid.UniqueID %>', 'Rebind'); | |
} | |
function clearDates() | |
{ | |
var dateInput1 = '<%= RadDatePicker1.ClientID %>'; | |
var dateInput2 = '<%= RadDatePicker2.ClientID %>'; | |
dateInput1.DateInput.Clear(); | |
dateInput2.DateInput.Clear(); | |
} | |
function SelectUnselect(treeView,action) | |
{ | |
for (var i=0; i<treeView.AllNodes.length; i++) | |
{ | |
if (action == "check") | |
{ | |
treeView.AllNodes[i].Check(); | |
} | |
else | |
{ | |
treeView.AllNodes[i].UnCheck(); | |
} | |
} | |
} | |
</script> | |
<div style="height:80px;"> | |
<span style="position:absolute;top:3px;left:3px; align:left;"><asp:Label id="lblHeading" Runat="server"></asp:Label></span> | |
</div> | |
<telerik:RadSplitter id="Radsplitter1" runat="server" width="100%" height="800" skin="Default"> | |
<telerik:RadPane id="LeftPane" runat="server" height="100%" width="22" skin="Default"> | |
<DIV style="Z-INDEX: 100; POSITION: relative"><!-- Put sliding menu on top of tabs --> | |
<telerik:RadSlidingZone id="ControlsSlidingZone" runat="server" width="22" InitiallyDockedPaneId="AllControlsSlidingPane" | |
clicktoopen="true" skin="Default"> | |
<telerik:RadSlidingPane id="AllControlsSlidingPane" title="All Controls" runat="server" width="310" scrolling="Y" | |
IconUrl="../../common/baseimages/refresh.gif" skin="Default"> | |
<telerik:RadAjaxLoadingPanel id="ajxlp2" height="75px" width="75px" Runat="server" skin="Default"> | |
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px;" /> | |
</telerik:RadAjaxLoadingPanel> | |
<telerik:RadAjaxPanel id="Radajaxpanel2" runat="server" LoadingPanelID="ajxlp2" skin="Default">Select Instrument:<BR> | |
<asp:DropDownList id="ddInstruments" Runat="server" Width="260" CssClass="inpt" OnSelectedIndexChanged="ddInstruments_SelectedIndexChanged" | |
AutoPostBack="True"></asp:DropDownList><BR><BR> | |
<TABLE cellSpacing="2" cellPadding="0" width="260"> | |
<TR> | |
<TD vAlign="middle" bgColor="silver" colSpan="2" height="1"></TD> | |
</TR> | |
<TR> | |
<TD class=buttonRow onmouseover="this.className='buttonRowOver'" | |
onclick="SelectUnselect(<%= AllControlsTree.ClientID %>,'check');" | |
onmouseout="this.className='buttonRow'" vAlign=top> <IMG src="../../common/baseimages/next.png" border="0"> Select All | |
Controls | |
</TD> | |
</TR> | |
<TR> | |
<TD vAlign="top" bgColor="silver" colSpan="2" height="1"></TD> | |
</TR> | |
<TR> | |
<TD class=buttonRow onmouseover="this.className='buttonRowOver'" | |
onclick="SelectUnselect(<%= AllControlsTree.ClientID %>,'uncheck');" | |
onmouseout="this.className='buttonRow'" vAlign=top> <IMG alt="Select None" src="../../common/baseimages/previous.png" border="0"> | |
Unselect All Controls | |
</TD> | |
</TR> | |
<TR> | |
<TD vAlign="top" bgColor="silver" colSpan="2" height="1"></TD> | |
</TR> | |
<TR> | |
<TD class=buttonRow onmouseover="this.className='buttonRowOver'" | |
onclick="AddControlsPostBack(<%= AllControlsTree.ClientID %>);" | |
onmouseout="this.className='buttonRow'"> <IMG alt="Add Controls" src="../../common/baseimages/ico_dlg.gif" border="0"> | |
Add Controls To Version | |
</TD> | |
</TR> | |
<TR> | |
<TD vAlign="top" bgColor="silver" colSpan="2" height="1"></TD> | |
</TR> | |
<TR> | |
<TD class="buttonRow" onmouseover="this.className='buttonRowOver'" onmouseout="this.className='buttonRow'"> | |
<asp:CheckBox id="chkPending" Runat="server" AutoPostBack="True" Text="Show Pending"></asp:CheckBox> | |
<asp:CheckBox id="chHistoric" Runat="server" AutoPostBack="True" Text="Show Historic"></asp:CheckBox> | |
</TD> | |
</TR> | |
<TR> | |
<TD vAlign="top" bgColor="silver" colSpan="2" height="1"></TD> | |
</TR> | |
</TABLE> | |
<telerik:RadTreeView id="AllControlsTree" Runat="server" Width="99%" OnContextMenuItemClick="Tree_ContextMenuItemClick" | |
OnClientContextMenuItemClicking="BeforeClientContextHandler" Height="60%"></telerik:RadTreeView></telerik:RadAjaxPanel> | |
</telerik:RadSlidingPane> | |
</telerik:RadSlidingZone></DIV> | |
</telerik:RadPane> | |
<telerik:RadSplitBar id="RadSplitBar1" runat="server" skin="Default"></telerik:RadSplitBar> | |
<telerik:RadPane id="ContentPane" runat="server" height="800" scrolling="Y" skin="Default"> | |
</telerik:RadPane> | |
</telerik:RadSplitter><telerik:RadWindowManager id="Singleton" runat="server" VisibleOnPageLoad="false" behavior="Close,Move" Skin="Default"></telerik:RadWindowManager> | |
</form> | |
</body> | |
</HTML> |
Thanks...
0
Hello Andy Hooper,
Unfortunately I cannot run your page. Could you try wrapping the script tags with a RadScriptBlock control as suggested earlier? Does this solve the problem? If not please open a support ticket and send us the codebehind of the page as well so we can test it locally.
Regards,
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Unfortunately I cannot run your page. Could you try wrapping the script tags with a RadScriptBlock control as suggested earlier? Does this solve the problem? If not please open a support ticket and send us the codebehind of the page as well so we can test it locally.
Regards,
Albert,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.