Click or drag to resize
KaxTabControlOnClientTabSelecting Property
Gets or sets a value indicating the client-side event handler that is called just prior to selecting a tab.

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 OnClientTabSelecting { 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 OnClientTabSelecting property to specify a JavaScript function that will be executed prior to tab selecting - either by left-clicking it with a mouse or hitting enter after tabbing to that tab. You can cancel that event (prevent tab selecting) by seting the cancel property of the event argument to true.

Two parameters are passed to the handler

  • sender (the client-side KaxTabControl object)
  • eventArgs with one property
    • tab - the instance of the selected tab
    • cancel - whether to cancel the event

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

<script language="javascript">
function ClientTabSelectingHandler(sender, eventArgs)
{
var tabControl = sender;
var tab = eventArgs.get_tab();

alert("You will be selecting the " + tab.get_text() + " tab in the " + tabControl.get_id() + " tabcontrol.");

if (tab.Text == "Education")
{
alert("Education cannot be selected");
eventArgs.set_cancel(true);
}
}
</script>

<kettic:KaxTabControl id="KaxTabControl1" runat="server" OnClientTabSelecting="ClientTabSelectedHandler">
<Tabs>
<kettic:KaxTab Text="Personal Details"></kettic:KaxTab>
<kettic:KaxTab Text="Education"></kettic:KaxTab>
<kettic:KaxTab Text="Computing Skills"></kettic:KaxTab>
</Tabs>
</kettic:KaxTabControl>

See Also