protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)
{
//your code logic here
Label1.Text = "Active Tab Index is " + TabContainer1.ActiveTabIndex;
}
Test Result:
Note:
The ajaxToolkit TabContainer control also provides some client side events, such as OnClientActiveTabChanged, OnClientClick(for TabPanel), you can get detailed information in it's
documentation.
With Regards,
Fei Han
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
26 Points
634 Posts
ajaxToolkit TabContainer question
Oct 18, 2018 01:41 AM|yzidell|LINK
i have an ajaxToolkit TabContainer - can i run some code when the user clicks on a tab?
thx for ur help
All-Star
40535 Points
6233 Posts
Microsoft
Re: ajaxToolkit TabContainer question
Oct 18, 2018 01:57 AM|Fei Han - MSFT|LINK
Hi yzidell,
You can achieve your requirement in ActiveTabChanged Event, you can refer to the following sample code.
Test Result:
Note:
The ajaxToolkit TabContainer control also provides some client side events, such as OnClientActiveTabChanged, OnClientClick (for TabPanel), you can get detailed information in it's documentation.
With Regards,
Fei Han
All-Star
50831 Points
9895 Posts
Re: ajaxToolkit TabContainer question
Oct 18, 2018 02:02 AM|A2H|LINK
TabPanel has a property called OnClientClick. You can use that to execute javascript code
Aje
My Blog | Dotnet Funda