Hi pardo,
Run the example I added below. Then press the button.
I hope the example is straightforward enough. If you have any questions please let me know.
Kind regards,
Wim
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TabContainer7.aspx.vb" Inherits="TabContainer7" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function myFunction()
{
var myTabContainer = $find('TabContainer1');
var activeTab = myTabContainer.get_activeTabIndex();
alert('active tab index = ' + activeTab);
if (confirm('Change active tab?'))
{
myTabContainer.set_activeTabIndex(0);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1">
<cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
<ContentTemplate>
Tab1
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
<ContentTemplate>
Tab2
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer><br />
<input id="Button1" type="button" value="button" onclick="myFunction()" />
</form>
</body>
</html>
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.