Click or drag to resize
KaxContextMenuOnClientShowing Property
Gets or sets a value indicating the client-side event handler that is called when the KaxContextMenu is to be displayed.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public virtual string OnClientShowing { 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

If specified, the OnClientShowing client-side event handler is called before the context menu is shown on the client. Two parameters are passed to the handler:

  • sender, the menu client object;
  • eventArgs with two properties, get_cancel()/set_cancel(cancel) and get_domEvent (a reference to the browser event).

The OnClientShowing event can be cancelled. To do so, set the cancel property to false from the event handler (e.g. eventArgs.set_cancel(true);).

Examples
The following example demonstrates how to use the OnClientShowing property.

<script type="text/javascript">
var shouldDisplayContextMenu = confirm("Do you want to enable context menus on this page?"); function onClientShowingHandler(sender, eventArgs)
{
eventArgs.set_cancel(!shouldDisplayContextMenu);
}
</script>
<Kettic:KaxContextMenu ID="KaxContextMenu1"
runat= "server"
OnClientShowing="onClientShowingHandler">
....
</Kettic:KaxContextMenu>

See Also