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

    Question

  • Hi All,

    I'm using .net framework 3.5. When I'm going to use AJAX tool kit on my web site always I got this error..

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

    Here is mt code

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

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
        <asp:Image ID="Image32" runat="server"
            ImageUrl="~/Secure/User/images/add_user.jpg" />
    </asp:Content>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

        <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </cc1:ToolkitScriptManager>
       
       
        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
            Height="294px" Width="913px">
            <cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
            <ContentTemplate>
            <h1> gggg </h1>
            </ContentTemplate>
            </cc1:TabPanel>
       
        </cc1:TabContainer>
       
    </asp:Content>

    Please help me. I need to do this ASAP. Thank you

    • Edited by thilina_s Wednesday, October 28, 2009 6:23 PM
    Wednesday, October 28, 2009 5:50 PM

Answers

  • Hello,

    I suspect there are <%...%> blocks in your master page, please go and check the master page. Do we do something special in the master page, for example, databinding, javascript loading, etc...

    One of the workaround is adding a ContentPlaceHolder control in the master page. And doing other things special in our page. Please take a  look at this article for more information, also, this issue is discussed here: http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=16041

    By the way, for ASP.NET/Ajax issues, please post threads in our asp.net forums.

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by Roahn Luo Thursday, November 05, 2009 6:32 AM
    Tuesday, November 03, 2009 7:43 AM

All replies

  • can u post the code in a more read-friendly form?!? like use the CODE tag to keep identation and stuff... this would greatly easy things up
    Wednesday, October 28, 2009 5:58 PM
  • I think now you can read it. Thank you very much for the response.
    Wednesday, October 28, 2009 6:24 PM
  • Hello,

    I suspect there are <%...%> blocks in your master page, please go and check the master page. Do we do something special in the master page, for example, databinding, javascript loading, etc...

    One of the workaround is adding a ContentPlaceHolder control in the master page. And doing other things special in our page. Please take a  look at this article for more information, also, this issue is discussed here: http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=16041

    By the way, for ASP.NET/Ajax issues, please post threads in our asp.net forums.

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by Roahn Luo Thursday, November 05, 2009 6:32 AM
    Tuesday, November 03, 2009 7:43 AM