Showing posts with label displays. Show all posts
Showing posts with label displays. Show all posts

Monday, March 26, 2012

Tab Panel displays content of other tab panel

I have a tab container with 4 tabs in it. One that is hidden from certain users. We will refer to this as tab panel 3. When you browse to the page as one of these users the tab control is displayed properly, without tab panel 3. You can select the other tab panels and their content is correct. In tab panel 4 there is a button that causes a post back. When you click on this button the content displayed in tab panel 4 is now the content from tab panel 2 and the content from tab panel 4. If you then select tab panel 1 you see the same behavior, it's content is that of tab panel 2 and tab panel 1. If you select tab panel 2 it seems to reset the tab panels and they all display with the proper content.

any ideas?

ok, the way that the one tab was hidden from certain users was that I left off the headertext for that tab. effetively keeping anyone from getting to it. For some reason this was causing the unexpected behavior.


Correct me from wrong, I guess we're trying to make a tab invisible conditionally using visible property. If yes, instead of using visible property, try to use Enable property to do so. Good luck.


I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

I saw this same behavior when I was dynamically adding tabpanels. 



I fixed this by wrapping the tabpanel content in updatepanels.

Wednesday, March 21, 2012

TabContainer question.

Hi,
After reading some messages on this forum, I finally found an issue to my problem about the headerText that displays when I set to false the visible tabpanel.
I use this syntax
TabContainter[1].Enabled=false;

Now I really need help on this topic.
As I said, I have a tabcontainer with 3 tabpanels.
When I am in "created" mode (that means the user will create a new item), it's only the first tabpanel is displayed.
So I what I want is when the user presses the "Add" button of the first TabPanel, the 2 other panels become visible.

I thank you in advance for your precious help.
Stan

Here's a part of my current code that doesn't work (of course)..

<cc1:TabContainer ID="myTabContainer" runat="server" Width="905" >
<cc1:TabPanel ID="myFistTab" runat="server" HeaderText="Identité">
<ContentTemplate>
<asp:UpdatePanel ID="upd" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtname" runat="server" /><br />
<asp:Button ID="btnupd" OnClick="btnupd_Click" runat="server" Text="Add" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="mySecondTab" runat="server" HeaderText="Details">
<ContentTemplate>bla bla</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="myThirdTab" runat="server" HeaderText="Stats" >
<ContentTemplate>Bla bla</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>

The code behind

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
myTabContainer.Tabs[1].Enabled = false;
myTabContainer.Tabs[2].Enabled = false;
}
}

protected void btnupd_Click(object sender, EventArgs e)
{
updateDataBase();
myTabContainer.Tabs[1].Enabled = true;
myTabContainer.Tabs[2].Enabled = true;
}


I think you need to set AutoPostBack on the TabContainer to "true":

<cc1:TabContainer ID="myTabContainer" runat="server" AutoPostBack="true" Width="905" >

If that doesn't solve your problem, try removing the current UpdatePanel you have inside the tabPanel and wrapping the entire TabContainer in an UpdatePanel and see if the tabs show when btnupd_Click event fires.


Kylen,

I test with AutoPostBack sets to true. It doesn't work.
If I remove the UpdatePanel that is inside the TabPanel, everything works, but all the page is reloaded.
I suppose I have to call a jscript function to "enabled" the tabs but I don't know how to do it.
Stan


Hi Stan,

The right suggestion has been given by Kylen. Here is the sample. Hope it helps.

ASPX Code:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="TabTest.aspx.cs" Inherits="TabTest" %><%@. 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"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="upd" runat="server"> <ContentTemplate> <cc1:TabContainer ID="myTabContainer" runat="server" Width="905"> <cc1:TabPanel ID="myFistTab" runat="server" HeaderText="Identité"> <ContentTemplate> <asp:TextBox ID="txtname" runat="server" /><br /> <asp:Button ID="btnupd" OnClick="btnupd_Click" runat="server" Text="Add" /> </ContentTemplate> </cc1:TabPanel> <cc1:TabPanel ID="mySecondTab" runat="server" HeaderText="Details"> <ContentTemplate> bla bla</ContentTemplate> </cc1:TabPanel> <cc1:TabPanel ID="myThirdTab" runat="server" HeaderText="Stats"> <ContentTemplate> Bla bla</ContentTemplate> </cc1:TabPanel> </cc1:TabContainer> </ContentTemplate> </asp:UpdatePanel> </form></body></html>

If any problems, please let me know!