ASP.NET AJAX Tabs Control
The Tabs control allows you to create the Tabs very quickly. The tabs can be changed without causing a postback. I recently created tabs based on the data from the Categories and Products table in the Northwind database.
Check out the code below which creates the TabPanel dynamically and then add to the TabsContainer control.
protected
void Page_Load(
object sender,
EventArgs e)
{
if (!Page.IsPostBack)
{
List<Category> categories = Category.GetCategories();
foreach (Category category in categories)
{
GridView gv = new GridView();
gv.DataSource = category.Products;
gv.DataBind();
AjaxControlToolkit.TabPanel tab = new AjaxControlToolkit.TabPanel();
tab.Controls.Add(gv);
tab.HeaderText = category.CategoryName;
TabContainer1.Tabs.Add(tab);
}
}
}

Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using