http://tinyurl.com/86m8m6
The above link takes you to a screen capture of the error im getting. I've used the code from the example provided for dynamically loading/saving Dock's from a database.
I think I've narrowed the issue, but I'm not sure how to correct it.
What I've done is: For each type of dock I want to add, I have defined a ContentTemplate in an ascx (each one has their own ascx).
When a user clicks a linkbutton, one of the below 3 are triggered.
If, for instance, I trigger the AddType1DockLinkButton, it works fine and I can continue to click it and add as many as I want. But, as soon asI click one of the other types, it crashes.
I think it has something to do with either the AsyncPostBackTriggers or StartUpScripts that I'm registering.
Here's the code where I create the RadDock. (not the most beautiful at this point, I'm just trying to get it to work.
The above link takes you to a screen capture of the error im getting. I've used the code from the example provided for dynamically loading/saving Dock's from a database.
I think I've narrowed the issue, but I'm not sure how to correct it.
What I've done is: For each type of dock I want to add, I have defined a ContentTemplate in an ascx (each one has their own ascx).
When a user clicks a linkbutton, one of the below 3 are triggered.
<asp:updatepanel runat="server" id="UpdatePanel1"> |
<triggers> |
<asp:asyncpostbacktrigger controlid="AddType1DockLinkButton" eventname="Command" /> |
<asp:asyncpostbacktrigger controlid="AddType2DockLinkButton" eventname="Command" /> |
<asp:asyncpostbacktrigger controlid="AddType3DockLinkButton" eventname="Command" /> |
</triggers> |
</asp:updatepanel> |
If, for instance, I trigger the AddType1DockLinkButton, it works fine and I can continue to click it and add as many as I want. But, as soon asI click one of the other types, it crashes.
I think it has something to do with either the AsyncPostBackTriggers or StartUpScripts that I'm registering.
Here's the code where I create the RadDock. (not the most beautiful at this point, I'm just trying to get it to work.
private RadDock CreateRadDock(UIContent uiContent, int contentControlID) |
{ |
RadDock dock = new RadDock(); |
// Use the ID from uiContent, which holds all contentcontrols. |
dock.UniqueName = uiContent.ID.ToString(); //Guid.NewGuid().ToString(); |
dock.ID = string.Format("RadDock{0}", dock.UniqueName); |
//dock.Text = string.Format("Added at {0}", DateTime.Now); |
//dock.Width = Unit.Pixel(300); |
dock.TitlebarContainer.Height = Unit.Pixel(35); |
dock.EnableEmbeddedSkins = false; |
dock.ContentContainer.Style.Add(HtmlTextWriterStyle.Overflow, "hidden"); |
switch (uiContent.ContentTypeID) |
{ |
case 1: |
dock.Title = "Type1"; |
dock.TitlebarTemplate = Page.LoadTemplate("~/UIControls/ContentTitleBar.ascx"); |
dock.ContentTemplate = Page.LoadTemplate("~/contentcontrols/Type1.ascx"); |
break; |
case 2: |
dock.Title = "Type2"; |
dock.TitlebarTemplate = Page.LoadTemplate("~/UIControls/ContentTitleBar2.ascx"); |
dock.ContentTemplate = Page.LoadTemplate("~/contentcontrols/Type2.ascx"); |
break; |
case 3: |
dock.Title = "Type3"; |
break; |
default: |
dock.Title = "Untitled"; |
break; |
} |
DockCommand editCommand = new DockCommand(); |
editCommand.CssClass = "rdEdit"; |
editCommand.Text = "Edit Settings"; |
dock.Commands.Add(editCommand); |
dock.Commands.Add(new DockCloseCommand()); |
dock.Commands.Add(new DockExpandCollapseCommand()); |
dock.Command += new DockCommandEventHandler(dock_Command); |
return dock; |
} |