Me.WebTab1.ClientEvents.TabClosing = "WebTab1_TabClosing"
this.WebTab1.ClientEvents.TabClosing = "WebTab1_TabClosing";
// The client event TabClosing takes two parameters sender and e // sender is the object which is raising the event // e is the TabItemCancelEventArgs function WebTab1_TabClosing(sender, e) { //Gets the index of the closing tab var tabIndex = e.get_tabIndex(); if (tabIndex ==2) //Cancels the tab closing event if tab index is 2 e.set_cancel(true); }