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

RadtoolBarButton click

3 Answers 398 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Ragupathi
Top achievements
Rank 1
Ragupathi asked on 23 Jul 2008, 03:10 PM
I want to fire both client side and server side events on RadToolBarButton Click.Iam trying to achieve this with onbuttonclick and OnClientButtonClicked events. Is it possible?


Ragu

3 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 24 Jul 2008, 02:11 PM
Hi Ragupathi,

Yes, this is possible. The OnClientButtonClicked property should have the name of a client-side JavaScript event handler assigned, while the OnButtonClick event should get a RadToolBarEventHandler delegate.

Please, check the RadToolBar for ASP.NET Ajax Online Examples.

Regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Asutosh
Top achievements
Rank 1
answered on 14 Jun 2014, 12:48 PM
hi
i want every button seperate click  event in tool bar
how can i call backend event using button in radtoolbar?
0
Shinu
Top achievements
Rank 2
answered on 16 Jun 2014, 03:13 AM
Hi Asutosh,

Please try to set the CommandName for the RadToolBarButton and access it in the OnButtonClick event of  RadToolBar and write the code based on the condition as follows.

ASPX:
<telerik:RadToolBar ID="rtoolbarServerButtonClick" runat="server" OnButtonClick="rtoolbarServerButtonClick_ButtonClick">
    <Items>
        <telerik:RadToolBarButton Text="Button1" CommandName="Click1">
        </telerik:RadToolBarButton>
        <telerik:RadToolBarButton Text="Button2" CommandName="Click2">
        </telerik:RadToolBarButton>
    </Items>
</telerik:RadToolBar>

C#:
protected void rtoolbarServerButtonClick_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
{
    RadToolBarButton toolbarButton = (RadToolBarButton)e.Item;
    if (toolbarButton.CommandName == "Click1")
    {
        //your code
    }
    else
    {
        //your code
    }
}

Thanks,
Shinu.
Tags
Dock
Asked by
Ragupathi
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Asutosh
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or