ArgumentTypeException with OnClientButtonClicking

1 posts, 0 answers
  1. Cheryl
    Cheryl avatar
    7 posts
    Member since:
    Aug 2012

    Posted 09 May 2013 Link to this post

    Hello,

    I have a RadToolbar and a div that should load contents of another page using jquery.  Does anyone know why this error occurs:
    SysArgumentTypeException
    Object of type 'Telerik.Web.UI.RadToolbarCancelEventArgs' cannot be converted to type 'Sys.CancelEventArgs'

    Any help would be appreciated!

    <telerik:RadScriptManager ID="tmgRSM" runat="server" EnableCdn="true">
                <Scripts>
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
               </Scripts>
            </telerik:RadScriptManager>
      
            <telerik:RadToolBar ID="radToolBar1" runat="server"
                    Width="100%" EnableViewState="false" OnClientButtonClicking="OnToolBarButtonClick">
                    <Items>
                        <telerik:RadToolBarButton Text="Tab1" CommandName="Tab1" CheckOnClick="true" Checked="true"></telerik:RadToolBarButton>
                        <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Tab2" CommandName="Tab2" CheckOnClick="true"></telerik:RadToolBarButton>
                    </Items
            </telerik:RadToolBar>
              
            <div id="contentDiv" style="padding-left:20px"></div>
      
            <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
                <script type="text/javascript">
                    window.$ = $telerik.$;
      
                    $(document).ready(function () {
                        $('#contentDiv').load('Content.aspx');
                    });     
      
                    function OnToolBarButtonClick(sender, args) {
                        alert(args.get_item().get_commandName());
                    }
                </script>
            </telerik:RadCodeBlock>
Back to Top