I have a RadToolbar that is created using the following code:
| <telerik:RadToolBar ID="RadToolBar1" runat="server" OnButtonClick="RadToolBar1_ButtonClick" |
| CssClass="Toolbar" Skin="WebBlue" OnClientButtonClicked="ToolbarButtonClicked"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| <Items> |
| <telerik:RadToolBarButton runat="server" ImageUrl="~/Images/new_note.png" Text="Notes"> |
| </telerik:RadToolBarButton> |
| </Items> |
| </telerik:RadToolBar> |
I also have a a RadDock on the same page:
| <telerik:RadDockLayout ID="RadDockLayout1" runat="server" EnableAjaxSkinRendering="False" |
| EnableEmbeddedBaseStylesheet="False" EnableEmbeddedSkins="False"> |
| <telerik:RadDockZone ID="DocumentDockZone" runat="server" Height="105%" Width="100%" |
| FitDocks="False" bgcolor="#666666" BackColor="#666666" BorderStyle="None" BorderWidth="0px"> |
| <telerik:RadDock ID="NotesDock" runat="server" Width="99%" Skin="Office2007" DefaultCommands="ExpandCollapse" |
| DockHandle="None" Title="Notes" DockMode="Floating" ForbiddenZones="DocumentDockZone"> |
| <ContentTemplate> |
| <uc5:Notes ID="Notes1" runat="server" /> |
| </ContentTemplate> |
| </telerik:RadDock> |
| </telerik:RadDockZone> |
| </telerik:RadDockLayout> |
I have the following javascript code on the same page:
| function ToolbarButtonClicked(sender, args) |
| { |
| var button = args.get_item(); |
| var notesDocks = $find("<%= NotesDock.ClientID %>"); |
| if (button.get_text() == "Notes") |
| { |
| alert("Notes click"); |
| args.set_cancel(true); |
| } |
| } |
When the page attempts to load I get the following Exception:
System.Web.HttpException: "Error executing child request for Default.aspx."
InnerException: System.Web.HttpUnhandledException: "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."
This error only occurs when I attempt to get the NotesDock control in the javascript line "var notesDocks = $find("<%= NotesDock.ClientID %>");" But I need a reference to this object because I want to call notesDock.set_closed(false) at some point.
Any idea what might be causing this problem?