This is a migrated thread and some comments may be shown as answers.

Example throw exception

6 Answers 91 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 26 May 2011, 11:11 AM
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!

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 26 May 2011, 03:02 PM
Hello Jan,

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

Thanks,
Princy.
0
Jan
Top achievements
Rank 1
answered on 01 Jun 2011, 03:40 PM
I found it.

I have all the code in HEAD placeholder. Silly me.  Sorry guys!
0
Veronica
Telerik team
answered on 01 Jun 2011, 03:49 PM
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.

0
Jan
Top achievements
Rank 1
answered on 01 Jun 2011, 04:03 PM
Regarding my last post I would like to apologize for being stupid.
0
Muhammad Rashed
Top achievements
Rank 1
answered on 04 Aug 2015, 09:50 AM

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>‚Äč

0
Maria Ilieva
Telerik team
answered on 06 Aug 2015, 06:31 AM
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
Tags
Scheduler
Asked by
Jan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Jan
Top achievements
Rank 1
Veronica
Telerik team
Muhammad Rashed
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or