... below is the function usage:
ScriptManager.RegisterStartupScript(
dock,
this.GetType(),
"AddDock",
string.Format(@"function _addDock() {{
Sys.Application.remove_load(_addDock);
$find('{1}').dock($find('{0}'));
$find('{0}').doPostBack('DockPositionChanged');
}};
Sys.Application.add_load(_addDock);", dock.ClientID, DropDownZone.SelectedValue),
true);
If you go to the link I provided above, you see that it is adding docks every time you click a button. In my situation I need to add docks based on a list of RadDocks that I am passed. I have not been able to do this for some reason.
I tried something like this:
List<RadDock> dockList = RetrieveListOfDocks();
foreach (RadDock dock in dockList)
{
UpdatePanel1.ContentTemplateContainer.Controls.Add(dock);
ScriptManager.RegisterStartupScript(
dock,
this.GetType(),
"AddDock",
string.Format(@"function _addDock() {{
Sys.Application.remove_load(_addDock);
$find('{1}').dock($find('{0}'));
$find('{0}').doPostBack('DockPositionChanged');
}};
Sys.Application.add_load(_addDock);", dock.ClientID, RadDockZone1),
true);
}
But given my limited understanding of the control functions and the new framework, this did not work. My ultimate goal is to do a partial page postback (using the UpdatePanel) with different collections of RadDocks each time... so an event is fired, and new RadDocks appear in a RadDockZone of a page... Any help and guidance would be great.