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

RadScriptManager in a SharePoint WebPart

1 Answer 187 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Eraph
Top achievements
Rank 1
Eraph asked on 12 Sep 2011, 01:57 PM
I've been following the instructions on this page to get Telerik controls working in a SharePoint WebPart. I'm getting an error on the following line in the OnInit method:
this.Page.Form.Controls.AddAt(0, scriptManager);
The error says:
"The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases."
I reckon the RadScriptManager could be added to the masterpage, but because it is a WebPart we're building we'd much prefer to keep it as a self-contained object. Anyway, it looks like the example code isn't really valid. Am I missing something?

1 Answer, 1 is accepted

Sort by
0
Eraph
Top achievements
Rank 1
answered on 15 Sep 2011, 04:43 PM
Just tried adding the WebPart again today, and it's working. Not sure why, the code is the same! There were a lot of Windows Updates applied though, I reckon it could be to do with that.
Tags
ScriptManager and StyleSheetManager
Asked by
Eraph
Top achievements
Rank 1
Answers by
Eraph
Top achievements
Rank 1
Share this question
or