Showing posts with label visible. Show all posts
Showing posts with label visible. Show all posts

Wednesday, March 28, 2012

Tab Container Issue - Inside of Update Panel

I was attempting to have a tab container hidden (visible = false) when I load the page inside of an Update Panel. After entering in some search criteria and pressing load, the tab container would become visible, or so I thought. What I got was all of the tabs' header text just written out on one line with the first tab visible and no container. Has anyone ran into this or know a work around? Outside of that, I think this would qualify as a bug or need to be noted in the documentation that you cannot change the visibility of a Tab Container inseide of an Update Panel and expect it to work correctly.

PS. Toggling the visibility of the Tab Containers works fine when the Tab Container is outside of an Update Panel.

Hi,

I fail to reproduce the issue. Can you show me your code?

Monday, March 26, 2012

tab control not visible

Hi,

I have a project in to which i added the ajax control toolkit.Then i added the tab container to a page.

The are no errors while compiling ,But the tab control is not visible in the page after running.The code is as follows

<table width="100%" cellSpacing="1" cellPadding="0" align="left">

<tr>
<td style="width: 100%">
<ajaxToolkit:TabContainer runat="server" ID ="tabs" OnClientActiveTabChanged="ActiveTabChanged" ActiveTabIndex="0">
<ajaxToolkit:TabPanel ID ="panel1" runat="server" HeaderText=" Personal ">
<ContentTemplate>
<table width="100%" cellSpacing="1" cellPadding="0" >
<tr>
<td style="width: 110%">
<table width="100%" cellSpacing="1" cellPadding="0" align="left">
<tr>
<td class="itemcolor" >

Employee Id:</td>
<td class="itemcolor"><asp:TextBox ID="txtEmpCode" runat="server" width="198px"></asp:TextBox>
</td>
<td class="itemcolor" width="50"></td>
<td class="itemcolor">
Access Rights:</td>
<td class="itemcolor"><asp:DropDownList ID="ddlAcessRights" runat="server" Width="198px"></asp:DropDownList></td>
</tr>
<tr>
<td class="itemcolor" width="198"></td>
<td class="itemcolor" width="198"></td>
<td class="itemcolor" ></td>
<td class="itemcolor" width="198"></td>
<td class="itemcolor" width="198"></td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID ="panel2" runat="server" HeaderText=" Official ">
<ContentTemplate>
<table>
<tr>
<td>
<asp:TextBox runat="server" ID="test"></asp:TextBox>
</td>
</tr>
</table>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>

</td>
</tr>
</table>

Please help me

Thanks and regards

Prathibha

Hi,

I made a new page and copied your tabContainer-code into it and it displays just fine!

Do you get any errors?

Does other Ajax functionality work?

Do other ajaxControlToolkit-controls work?

Can you post the code of the whole page?

Please answer my questions!

Kind regards,
Wim


Couldn't see an error, so it must come from something else on the page.. Wild guess: rounded corners extender?

Edit:

- I copy pasted this exact code in a test.aspx..

- added the scriptmanager.

- got a javascript error saying: "ActiveTabChanged is undefined".Which is correct.. (And nothing showing.)

--> So I removedOnClientActiveTabChanged="ActiveTabChanged"

And then the page displayed correctly..


hi,Thanks to all.I got it correct.But i am not able to access the controls placed in the content template using javascript.

I have a textbox "txtEmpCode" placed in the content template of tab control.then i tried to access it as follows

document.getElementById("txtEmpCode")

But im getting null value

please help..

thanks n regards

prathibha


Hi Prathibh,

To access the control , please do it like this. $get("<%=txtEmpCode.ClientID%>"). $get equals to document.getElementById.

Best regards,

Jonathan


You needs to change your web config file for ajax supporting...for these you take File->New website->Ajax enabled website...and copy the special tags for ajax into your webconfig....

Saturday, March 24, 2012

tab visible to false at runtime??

The text of the tab shows up. How do I deal with that?

I found an answer:

http://forums.asp.net/p/1123799/1761705.aspx

Wednesday, March 21, 2012

TabContainer Enabled or Visible

Hi,
I have a Tabcontainer using 3 TabPanels. "Identity", "Invoices","stats".

I need to display the Invoices and Stats panels only when the Identify is on Update mode (the other status could be Create).
So I set the value of Visible property for these panels to False.
I don't have the css design Panels but the HeaderTexts are displayed.

I tried with the Enabled property, I get the same problem.

And by the way, what is the difference between Enabled and Visible for the TabContainer Control ?

Thanks for your help

Stan

Do you have to use this

TabContainer1.Tabs(1).Enabled =False

is work fine...


Hi Stan,

Here is a sample. It controls the HeadText at the client side. It's very simple and should be extended in your usage!

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="TabTest.aspx.cs" Inherits="TabTest" %><!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:Label ID="Label1" runat="server" Text="Label" Width="141px"></asp:Label><br /> <ajaxToolkit:TabContainer ID="TabContainer1" runat="server"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Identity"> <ContentTemplate> 1111111<br/> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Invoices" Visible="false"> <ContentTemplate> 222222<br/> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="stats" Visible="false" Enabled="false"> <ContentTemplate> 333333<br/> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <script type="text/javascript" language="javascript">Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function(sender, e){var tab1ID = "<%= this.TabContainer1.Tabs[1].ClientID%>";var tab2ID = "<%= this.TabContainer1.Tabs[2].ClientID%>";if(typeof(eval("document.all."+tab1ID))=="undefined"){ eval("document.all.__tab_"+tab1ID).innerHTML="";}if(typeof(eval("document.all."+tab2ID))=="undefined"){ eval("document.all.__tab_"+tab2ID).innerHTML="";}//alert(eval("document.all."+tab1ID))});</script> </form></body></html>

Difference between Enabled and Visible(We assume both of them are set to false):

1、Effect: Visible="false" HeadText is shown.

Enabled="false" HeadText isn't shown.

2、Client Code Visible ="false"

No

Enabled="false"

Sys.Application.add_init(function() { $create(AjaxControlToolkit.TabPanel, {"enabled":false,"headerTab":$get("__tab_TabContainer1_TabPanel3")}, null, {"owner":"TabContainer1"}, $get("TabContainer1_TabPanel3"));}); 3、Source code:if (!this._enabled) { this._hide();

}

_hide : function() {
this._tab.style.display = 'none';
if (this._get_active()) {
var next = this._owner.getNearestTab(false);
if (!!next) {
this._owner.set_activeTab(next);
}
}
this._deactivate();
}

For more details , please research this files: Tab.js, TabPanel.cs ,TabContainer.cs.

Hope it helps . If i misunderstood you, please let me know.