How do I determine which Button caused the client side event

3 posts, 0 answers
  1. Tim
    Tim avatar
    57 posts
    Member since:
    Apr 2011

    Posted 24 Jun 2011 Link to this post


    I am using a RadToolBar with several buttons.

    I can get the client side event to fire, but I cann't figure out how
    to identify which button was clicked.

    I'm sure its obvious. :-)

  2. Kate
    Kate avatar
    1898 posts

    Posted 30 Jun 2011 Link to this post

    Hello Tim,

    You could use the following client-side event handler to display the text of the clicked button as an alert message:
    <script type="text/javascript">
            function OnClientButtonClicking(sender, args) {
                var buttontext = args.get_item().get_text();

    Here is also the markup that I used for testing:
    <telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientButtonClicking="OnClientButtonClicking">
                   <telerik:RadToolBarButton runat="server" Text="Button 0" OuterCssClass="rtbItemFocused">
                   <telerik:RadToolBarButton runat="server" Text="Button 1" OuterCssClass="rtbItemClicked">
                   <telerik:RadToolBarButton runat="server" Text="Button 2" OuterCssClass="rtbItemClicked">

    All the best,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. DevCraft R3 2016 release webinar banner
  4. Yohancef
    Yohancef avatar
    7 posts
    Member since:
    Jun 2011

    Posted 30 Jun 2011 Link to this post


    You can also use the following client-side methods:



    item = eventArgs.get_item();


    item.get_value() // returns the value property of the button


    item.get_index() // returns the index of the button

Back to Top