Server Side Events

The server side events present in the Toolbar control are listed as follows.

Event Name Description Arguments
OnItemClick Triggered when the toolbar item is clicked e.Status-Status of the Toolbar

e.EventType – Event Name

e.Arguments – Contain keys and value of the Toolbar

The following section explains you on how to define server side event for a Toolbar control.

In an ASPX page, add the Toolbar control with OnItemClick event as shown in the following code example.

  • html
  • <%--Refer Local Data section for style and data bound for toolbar items.--%>
    <ej:Toolbar ID="toolbar" runat="server" Width="300px" OnItemClick="toolbar_ItemClick" DataIdField="Id" DataTooltipTextField="Tooltip" DataSpriteCssClassField="Css"></ej:Toolbar>

    In the code behind, define the action to be performed.

  • c#
  • protected void toolbar_ItemClick(object sender, EventArgs e)
       Response.Write("Server side event has been triggered");