Spell Check script errors due to <% ... %>

1 posts, 0 answers
  1. Nancy Moore
    Nancy Moore avatar
    2 posts
    Member since:
    Aug 2009

    Posted 18 Nov 2009 Link to this post

    I am trying to add the Rad Spell check to a RadTextBox.  I followed the instructions carefully and have succes IF I create a page with just the javascript SpellcheckDone function and the RadTextBox and the RadSpell.  If, however, I add this code to an existing page, it will build with no errors; but when I try to bring up the page with the spell check javascript function on it, I get the following error:

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

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
       System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +8668018
       Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +214
    
    [HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.]
       Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +279
       Telerik.Web.UI.RadAjaxControl.PerformRender() +502
       Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1849
       Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +158
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Page.Render(HtmlTextWriter writer) +29
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

    Nevermind ... I finally figured out that the RadCodeBlock could go around the <script></script> code; and then it works without errors.

     

     

     

Back to Top