Wednesday, March 28, 2012

Tab Control - not saving active tab on postback

I have a tab control and this is more of an annoyance than anything right now but when a linkbutton in the current tabpane causes a postback the tab jumps back to its original state

(meaning that the tab index is reset to 0 I guess but any way the tab the user is on changes back to its default setting - the first tab)

Does something need to be set ?

TIA

TheTabs demo does a full postback and shows how the client state is preserved. Not sure why this is not working for you.

yeah i cant quite figure it out eiter since i copied it directly from the toolkit example

here the html if you can think of anything

1<ajaxToolkit:TabContainer runat="server" ID="Tabs" Height="300px" Width="100%" ActiveTabIndex="0">2 <ajaxToolkit:TabPanel runat="Server" ID="Panel1" HeaderText="Table of Contents">3 <ContentTemplate>456<DNN:DNNTREE id="DNNTree1" runat="server" cssclass="CommandButton">7</DNN:DNNTREE>89 </ContentTemplate>10 </ajaxToolkit:TabPanel>1112 <ajaxToolkit:TabPanel runat="Server" ID="Panel3" HeaderText="Index" >13 <ContentTemplate>14 <asp:UpdatePanel ID="UpdatePanel2" runat="server">15 <ContentTemplate >16 <asp:DataList ID="lstIndex" runat="server">17 <ItemTemplate >18 <li><asp:LinkButton ID="lbItemTitle" runat="server" CommandArgument="View">LinkButton</asp:LinkButton></li>19 </ItemTemplate>20 </asp:DataList></ContentTemplate>21 </asp:UpdatePanel>22 </ContentTemplate>23 </ajaxToolkit:TabPanel>2425 </ajaxToolkit:TabContainer>
 
I acutually worked around it with the updatepanel around the datalist in the second panel but it would be interesting to know why it didnt work

No comments:

Post a Comment