RadScriptManager in a SharePoint WebPart

2 posts, 0 answers
  1. Eraph
    Eraph avatar
    11 posts
    Member since:
    Aug 2010

    Posted 12 Sep 2011 Link to this post

    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?
  2. Eraph
    Eraph avatar
    11 posts
    Member since:
    Aug 2010

    Posted 15 Sep 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top