Click or drag to resize
KaxToolBarOnClientContextMenu Property
Gets or sets a value indicating the client-side event handler that is called before the browser context menu shows (after right-clicking an item).

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public string OnClientContextMenu { get; set; }

Property Value

Type: String
A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.
Remarks

Use the OnClientContextMenu property to specify a JavaScript function that will be executed before the context menu shows after right clicking an item.

Two parameters are passed to the handler

  • sender (the client-side KaxToolBar object)
  • eventArgs with two properties
    • item - the instance of the selected toolbar item
    • domEvent - the reference to the browser DOM event
Examples
The following example demonstrates how to use the OnClientContextMenu property.

<script language="javascript">
function onContextMenuHandler(sender, eventArgs)
{
var toolBar = sender;
var item = eventArgs.get_item();

alert(String.format("You have right-clicked the {0} item in the {1} toolBar.", item.get_text(), toolBar.get_id());
}
</script>

<kettic:KaxToolBar id="KaxToolBar1" runat="server" OnClientContextMenu="onContextMenuHandler">
<Items>
<kettic:KaxToolBarButton Text="Bold"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Italic"></kettic:KaxToolBarButton>
<kettic:KaxToolBarButton Text="Underline"></kettic:KaxToolBarButton>
</Items>
</kettic:KaxToolBar>

See Also