Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I have a TabControl that contains 5 TabPage I want when I clicked on a button changes the color tab and I go to the next tabpage
thank you
Posted

Check out this [^] CP article. Should give you what you want!
 
Share this answer
 
Take a hidden field on the page which will store the current tab index of the page and set the value of that hidden field to 0 by default.
Then try this is your code:
C#
protected void btn_click(object sender, EventArgs e)
{
    hdfTabIndex.Value = (Convert.ToInt32(hdfTabIndex.Value)+1).ToString();
    ctlTabContainer.ActiveTabIndex = Convert.ToInt32(hdfTabIndex.Value)+1;
    /*Change your button style here*/
    btnNext.ForeColor = Color.Blue;
    btnNext.Text = hdfTabIndex.Value + "Tab";
}



Hope it helps.
--Amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900