I'm creating docks dynamically and trying to add a RadMenu, created in code, to the dock content. I'm receiving the following error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Script controls may not be registered after PreRender
The code that creates it is very simple:
All other manner of controls and user controls work fine, but this is the first time I'm attempting to dynamically add a telerik control inside the dock. Anyone know what I'm doing wrong here?
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Script controls may not be registered after PreRender
The code that creates it is very simple:
| else if (dockType == "Menu") |
| { |
| dock = new RadDock(); |
| RadMenu menu = new RadMenu(); |
| menu.Items.Add(new RadMenuItem("Home")); |
| menu.Items.Add(new RadMenuItem("Benefits")); |
| menu.Items.Add(new RadMenuItem("Personal")); |
| menu.Items.Add(new RadMenuItem("Custom")); |
| dock.ContentContainer.Controls.Add(menu); |
| } |
All other manner of controls and user controls work fine, but this is the first time I'm attempting to dynamically add a telerik control inside the dock. Anyone know what I'm doing wrong here?