Sunday, March 11, 2012

TabControl and TabPanel not appearing

Try removing the ActiveTabIndex(or try setting it to 1)... I believe that the tab indexes start with 1, not 0.

-Damien


ActiveTabIndexes start with 0, not 1...

and you can't delete it, it whould always be set to one of the existent tabs on your Page layout...

Try looking for any style you migh have set to a table (row or cell) or <DIV> or panel where your TabControl is nested, it might be the case that some panel is set to an invisible mode and your tabcontrol is inside it...


Hi,

I have tested your code,and it works on my machine.

And I simplified your code to the following code:

<%@. Page Language="C#" %>

<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:TabContainer ID="TabContainer1" runat="server" Height="200">
<cc1:TabPanel ID="TabPanel1" runat="server">
<HeaderTemplate>
Tab 1 Header</HeaderTemplate>
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
</cc1:TabPanel>

<cc1:TabPanel ID="TabPanel2" runat="server">
<HeaderTemplate>
Tab 2 Header</HeaderTemplate>
<ContentTemplate>
<asp:Button ID="Button2" runat="server" Text="Button" />
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

No need 'Visible="true" ActiveTabIndex="0"', no need 'HeaderText="TAB1" Height="200" Visible="true"'.

Best Regards


Thank you so much for your reply. When I cut and paste your code, I still don't see any Tab control.

Do you actually see 3 tabs on your page? My page is just blank.

Thanks again, Jason


It sounds like you may not have AJAX configured correctly, you shouldcheck out some of the common problems/fixes

-Damien


I created an entirely new AjaxEnabled web site and the code works. As you suggest, I must have missed one of those infinite changes when upgrading from Atlas to Ajax.

Thanks,
Jason

No comments:

Post a Comment