Example throw exception

7 posts, 0 answers
  1. Jan
    Jan avatar
    37 posts
    Member since:
    May 2008

    Posted 26 May 2011 Link to this post

    Hi guys,

    I found this excellent example

    http://demos.telerik.com/aspnet-ajax/scheduler/examples/outlook2007/defaultcs.aspx

    Which is just what I need to implement.

    But when I copy and paste into my application I get this error

    The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.


    and stack trace

    [HttpException (0x80004005): The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.]
       System.Web.UI.ControlCollection.Add(Control child) +11274544
       Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +619
    
    [HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.]
       Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +724
       Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl _control) +1182


    Do you have any clue, what I'm doing wrong?

    Many thanks!
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 May 2011 Link to this post

    Hello Jan,

    Please go through the Demo isolation steps (under source code)  and try.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jan
    Jan avatar
    37 posts
    Member since:
    May 2008

    Posted 01 Jun 2011 Link to this post

    I found it.

    I have all the code in HEAD placeholder. Silly me.  Sorry guys!
  5. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 01 Jun 2011 Link to this post

    Hello Jan,

    Did you wrapped the javascript code in a RadCodeBlock control as suggested in the stack trace and what is the result?

    Greetings,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Jan
    Jan avatar
    37 posts
    Member since:
    May 2008

    Posted 01 Jun 2011 Link to this post

    Regarding my last post I would like to apologize for being stupid.
  7. Muhammad Rashed
    Muhammad Rashed avatar
    2 posts
    Member since:
    Dec 2014

    Posted 04 Aug 2015 Link to this post

    I have the same exception, but I Added the grid in the Sharepoint web part 

     

    I did not add any code behind  , I just added to the aspx the following : 

    <telerik:RadGrid ID="RadGrid1" runat="server" >

    </telerik:RadGrid>​

  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 06 Aug 2015 Link to this post

    Hello Muhammad,

    In order to fix the problem try moving the SPWebPartManager control in the MasterPage from the HEAD section into the BODY section of the html MasterPage.  

    This is what you need to move into the BODY:

            <!--MS:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">-->
                <!--MS:<WebPartPages:SPWebPartManager runat="server">-->
                <!--ME:</WebPartPages:SPWebPartManager>-->
            <!--ME:</SharePoint:AjaxDelta>-->


    Hope it helps.

    Regards,
    Maria Ilieva
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017