Bug in OnClientButtonClicked?

2 posts, 1 answers
  1. adi
    adi avatar
    79 posts
    Member since:
    Feb 2007

    Posted 07 May 2009 Link to this post


    I have a RadToolBar on my page. It should be called a client side javascript and therefore I use the OnClientButtonClicked event. If I render the page I get the following error:

    Message: Expected '}'
    Line: 783
    Char: 447
    Code: 0

    This is what is generated on client:

    $create(Telerik.Web.UI.RadToolBar, {"_skin":"Default","attributes":{},"clientStateFieldID":"ucDetails_Address_ClientState","collapseAnimation":"{\"duration\":450}","expandAnimation":"{\"duration\":450}","itemData":[{"items":[{"value":"1","cssClass":"rtbWrap"},{"value":"2","cssClass":"rtbWrap"}],"type":2}]}, {"buttonClicked":onAddress(this'Adress'); return false;}, null, $get("ucDetails_Address")); 

    This is my code on ascx:

    <telerik:RadToolBar ID="Address" runat="server" OnClientButtonClicked="onAddress(this, 'Adress'); return false;"></telerik:RadToolBar> 

    I add the buttons as SplitButtons server side by xml.The message is right. The generated code is not well formed. Do you have any suggestion?

  2. Answer
    Yana avatar
    4547 posts

    Posted 07 May 2009 Link to this post


    Actually you cannot send parameters to the event handlers like this, the event handler receives only 2 parameters as is explained here. This is due to the ASP.NET AJAX convention for client-side events.

    Regards, Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft R3 2016 release webinar banner
Back to Top