Me.WebTab1.ClientEvents.TabAdding = "WebTab1_TabAdding"
this.WebTab1.ClientEvents.TabAdding = "WebTab1_TabAdding";
// The client event TabAdding takes two parameters sender and e // sender is the object which is raising the event // e is the TabItemCancelEventArgs function WebTab1_TabAdding(sender, e) { //Gets the index where a new tab is going to be added var tabIndex = e.get_tabIndex(); if (tabIndex>19) //Cancels the TabAdding event if tab index greater than 19 e.set_cancel(true); }