Showing posts with label linkbutton. Show all posts
Showing posts with label linkbutton. Show all posts

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

Wednesday, March 21, 2012

TabContainer Control

Hi,

I am facing an issue with the tabcontainer control. Inside the tabPanel i have an updatepanel which contains a linkbutton set as a trigger to update the content of the tabPanel.

Somehow the server side click event of the linkbutton is not getting fired.

Below is my code snippet :

 <cc1:TabContainer id="Tabs1" runat="server" OnClientActiveTabChanged="ActiveTabChanged" Height="150px"> <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Inbox" CssClass="tabClass" > <ContentTemplate><!--E-Claims form system--> <asp:UpdatePanel ID="claimUpdate" runat="server"> <ContentTemplate><!--Panel to hide the content--> <asp:Panel ID="panel4" runat="server" CssClass="fontClass" BackColor="#082f73" width="682"> <div style="padding:5px; cursor: pointer; vertical-align: middle;"> <div style="float: left;">E-Claim</div> <div style="float: right; margin-left: 20px;" > <asp:LinkButton ID="lnk2" runat="server" Text="Show Details" ForeColor="#ffffff"/> </div> </div> </asp:Panel><!--Content to show--> <asp:Panel id="panel3" runat="server"> <asp:UpdatePanel ID="updatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:GridView ID="grid2" runat="server"> </asp:GridView> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnk2" EventName="Click" /> </Triggers> </asp:UpdatePanel>   </asp:Panel> </ContentTemplate> </asp:UpdatePanel> <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender2" runat="server" TargetControlID="panel3" ExpandControlID="panel4" CollapseControlID="Panel4" Collapsed="True" TextLabelID="lnk2" CollapsedText="Show Details.." ExpandedText="Hide Details.." > </cc1:CollapsiblePanelExtender> </ContentTemplate> </cc1:TabPanel> </cc1:TabContainer>

I too am facing a similar issue.I have a simple tabcontainer control on a page and within its tabpanel, an asp:button. Clicking on the button doesnt raise any server side event. I have tried several things but nothing seems to work. The moment i remove the tabcontainer, it works just fine.

Thanks.


Hi,

I tried it, the click event handler fired. Here is my code:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void lnk2_Click(object sender, EventArgs e) { }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <input type="button" onclick="access()" /> <script type="text/javascript" src="JScript.js"></script> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>   <ajaxToolkit:TabContainer id="Tabs1" runat="server" Height="150px"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Inbox" CssClass="tabClass" > <ContentTemplate><!--E-Claims form system--> <asp:UpdatePanel ID="claimUpdate" runat="server"> <ContentTemplate><!--Panel to hide the content--> <asp:Panel ID="panel4" runat="server" CssClass="fontClass" BackColor="#082f73" width="682"> <div style="padding:5px; cursor: pointer; vertical-align: middle;"> <div style="float: left;">E-Claim</div> <div style="float: right; margin-left: 20px;" > <asp:LinkButton ID="lnk2" runat="server" Text="Show Details" ForeColor="#ffffff" OnClick="lnk2_Click"/> </div> </div> </asp:Panel><!--Content to show--> <asp:Panel id="panel3" runat="server"> <asp:UpdatePanel ID="updatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:GridView ID="grid2" runat="server"> </asp:GridView> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnk2" EventName="Click" /> </Triggers> </asp:UpdatePanel> </asp:Panel> <ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender2" runat="server" TargetControlID="panel3" ExpandControlID="panel4" CollapseControlID="Panel4" Collapsed="True" TextLabelID="lnk2" CollapsedText="Show Details.." ExpandedText="Hide Details.." Enabled="True" > </ajaxToolkit:CollapsiblePanelExtender> </ContentTemplate> </asp:UpdatePanel> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> </div> </form></body></html>