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

7 posts, 0 answers
  1. Irfan
    Irfan avatar
    8 posts
    Member since:
    Mar 2012

    Posted 20 Mar 2012 Link to this post

    Hi,
     I have downloaded latest trial version of RadControls for ASP.NET.

    I am just trying to use the RadEditor in my asp.net mvc view.
    I tried http://www.telerik.com/help/aspnet-ajax/editor-getting-started.html
    and
    http://www.telerik.com/help/aspnet-ajax/mvc-using-editor.html

    I just placed the editor on my view, no coding, nothing, but still i am getting the following error message in execution -
    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    I have looked various forums on telerik but doesn't found appropriate one to get the answer.
    So finally requesting the support.

    I have also created support ticket (523566) for this issue.

    Please find the attached code i have tried.
    Please help me resolve this issue.

    Thanks and regards
    Irfan Sheikh
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 21 Mar 2012 Link to this post

    Hello,

    I examined the provided project and found that this generic ASP.NET error is due to you have placed server tags inside the runat=server head tag of the master page. I fixed it by wrapping the script tag inside RadCodeBlock, e.g.
    Copy Code
    <telerik:RadCodeBlock id="RadCodeBlock1" runat="server">
      <script src="<%: Url.Content("~/Scripts/jquery-1.4.4.min.js") %>" type="text/javascript"></script>
      </telerik:RadCodeBlock>

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Irfan
    Irfan avatar
    8 posts
    Member since:
    Mar 2012

    Posted 22 Mar 2012 Link to this post

    Thanks Rumen
    For your kind support even in trial period.
  5. hemant
    hemant avatar
    2 posts
    Member since:
    Feb 2014

    Posted 05 Mar 2014 Link to this post

    i have installed a trial version of telerik for asp.net web application development  but if i used any of telerik control like rad data grid then i an having an error like "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." please reply as soon as possible...
  6. hemant
    hemant avatar
    2 posts
    Member since:
    Feb 2014

    Posted 05 Mar 2014 in reply to hemant Link to this post

    I have seen earlier your post regarding to this error but i did not understand where I have to Change in my code..
  7. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 06 Mar 2014 Link to this post

    Hi Hemant,

    The problem described by Irfan and resolved by Rumen is an isolated case and it is related also to MVC.

    Please open a new thread with more information about:
    • Is the built project an MVC one?
    • Do you have issues with ordinary ASP.NET control?
    • Ca you verify that the markup of the controls does not contain properties or attributes in comment blocks?

    A new support thread with detail about the project or attached one that demonstrates the problem will be very helpful for us to isolate and investigate the problem.


    Regards,
    Ianko
    Telerik

    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

  8. Suresh
    Suresh avatar
    2 posts
    Member since:
    Jun 2016

    Posted 13 Jun in reply to Rumen Link to this post

    Its great help!!!

    wrapping javascript inside <telerik:RadScriptBlock ID="radSript1" runat="server"> worked for me.

     

    Thanks

    Suresh T G

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017