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

Assigning client-side event handler in code behind

1 Answer 154 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Val
Top achievements
Rank 1
Val asked on 08 Aug 2008, 04:57 AM
I need to dynamically specify the client side event handler in code behind but I don't seem to figure it out. Tried to no avail the following:

MyRadToolBarRefresh.Attributes.Add("OnClientButtonClicking","ToolbarCheckDirty");

or MyRadToolBarRefresh.OnClientButtonClicking = "ToolbarCheckDirty";

or Page.ClientScript.RegisterStartupScript(Page.GetType(), "RadToolBarRefresh_ButtonClicking", "$find('" +.MyRadToolBarRefresh.ClientID +      "').add_buttonClicking(ToolbarCheckDirty)", true)

or RadAjaxManagerMaster.ResponseScripts.Add("$find('" + MyRadToolBarRefresh.ClientID + "').add_buttonClicking(ToolbarCheckDirty)");

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 08 Aug 2008, 03:10 PM
Hi Val,

This code snippet should work:

MyRadToolBarRefresh.OnClientButtonClicking = "ToolbarCheckDirty" 

Please check the attached project for a reference.

Kind regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolBar
Asked by
Val
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or