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.ControlsAssembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntaxpublic virtual string OnClientShowing { get; set; }
Public Overridable Property OnClientShowing As String
Get
Set
public:
virtual property String^ OnClientShowing {
String^ get ();
void set (String^ value);
}
abstract OnClientShowing : string with get, set
override OnClientShowing : string with 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.
RemarksIf 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