This is a migrated thread and some comments may be shown as answers.

Bug in OnClientButtonClicked?

1 Answer 83 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
adi
Top achievements
Rank 1
adi asked on 07 May 2009, 10:33 AM

Hi,

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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 07 May 2009, 12:18 PM
Hello,

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.
Tags
ToolBar
Asked by
adi
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or