Hey guys I’m running into a weird issue.. Basically, a user logs into a page and based on his role status(admin or user) determines how many tabs he sees in a tabcontainer. If he is just a “user” then tab index 0 and 1 need to be hidden because they contain admin only functionality.
Doing this is simple:
if(user)
{
Container.Tabs[0].visible = false;
Container.Tabs[1].visible = false;
}
However the problem is if I set more than 1 tab index to visible = false the entire container disappears. Could this be a bug? I know you can only have one tab visible at a time.
Is there a fix? Or should I use a multiview?
Thanks, Josh
It appears this might be a bug with the Ajax Control Toolkit, I tested with the latest version (.net 3.5) and was able to reproduce the problem. It seems the toolkit doesn’t like it when you set tab 0 to visible, the number of other visible/invisible tabs doesn’t matter.
I would suggest that you work around this by doing:
This has the same effect, and since your tabs are defined via the ASPX markup doing a postback without the remove calls will result in your tabs reappearing (if you needed to reshow them for some reason).