I keep getting this error when I try to view a certain page with IE7. I do not get the error with Firefox 2. I have two pages that have tabs, but only receive an error on one of them. It occasionally works with no problems. If I set the first panel's visible property to false, then it works fine. The first panel contains an 2 update panels with a filtered text boxes, an update panel with a calendar extender, and an update panel with a mask edit extender and mask edit valuator. I also use framesets. Could any of this be causing the error? Does anyone know a work around?
Wednesday, March 28, 2012
Tab Container Javascript Error: Unspecified Error
tab control
dear All
I have a tab container with 2 tab panels (say tabpanel1 and tabpanel2). ONLY when tabpanel2 is selected I wanted an event to fire. can someone tell me how to do this?
a little code would be a great help.
prasad.
var tabs = $find('TabsBehaviorID');
tabs._addActiveTabChanged(YourHandlerHere);
You can then check the tab index in the handler and ignore if it is not tabpanel2.
it says unexpected character $ (Dollar sign)
This was clientside JS code that I posted that needs to be included in <script> tags...have you done that? Maybe if you could post some code that would help.
i dont quite understand..I just have a tab with two panels in the aspx code.
<cc1:TabContainer ID="TabContainer2" runat="server">
<cc1:TabPanel ID="TabPanel1" HeaderText="Tab1" runat="server">
<ContentTemplate>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" HeaderText="Tab2" runat="server">
<ContentTemplate>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
I want the following. When tab2 is selected, I want to do some calculations in the code behind...and display them in tab2.
on the other hand when tab1 is selected then I want nothing to happen.
How do I call this event? can you help me with some code behind?
prasad..
Ahhh...you want a server side solution. The tab container doesn't currently postback when a tab is changed so you have to force this to happen manually. The following code demonstrates this:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /><script type="text/javascript"> function ActiveTabChanged(sender, e) { __doPostBack('<%= TabContainer2.ClientID%>', sender.get_activeTab().get_headerText()); }</script><asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="conditional"> <ContentTemplate> <cc1:TabContainer ID="TabContainer2" runat="server" OnActiveTabChanged="TabContainer2_ActiveTabChanged" OnClientActiveTabChanged="ActiveTabChanged"> <cc1:TabPanel ID="TabPanel1" HeaderText="Tab1" runat="server"> <ContentTemplate> </ContentTemplate> </cc1:TabPanel> <cc1:TabPanel ID="TabPanel2" HeaderText="Tab2" runat="server"> <ContentTemplate> </ContentTemplate> </cc1:TabPanel> </cc1:TabContainer> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="TabContainer2" EventName="ActiveTabChanged" /> </Triggers></asp:UpdatePanel>You can then hook up to the event in the code behind as follows:
protected void TabContainer2_ActiveTabChanged(object sender, EventArgs e){}
thank you for the code, is it possible that there is a postback only when tab panel2 is selected and NOT when tabpanel1 is selected?
prasad.
sender.get_activeTab().get_tabIndex() will tell you which tab is the new active tab so you can selectively fire the postback.
thank you. that helped.
BTW do you know how to change the tabs background color? using the
<cc1:TabPanel ID="TabPanel1" BackColor="#CECABB" runat="server">
doesnt change the color.
prasad-
http://community.bennettadelson.com/blogs/rbuckton/archive/2007/02/02/Skinning-model-for-Calendar-and-Tabs-in-Ajax-Control-Toolkit.aspx
thank you a ton!
Hi everybody!!!
Hi Would like, How do to the Tab Painel to load the content..only when it is called...because, on this samples of Jason, the content is being loaded with a firts postback.... is it possible ?
I Need this, because i've five gridviews in my page, and this stays bad...
Thank all!!!
p.s: my english isn't good
You can use dynamic population via a web service using the Dynamic* properties of the tab panel control. If the tab panels need to contain server controls that postback, then you will have to create the tab panel controls during a postback (not via a web service).
Tab Control
the linkhttp://community.bennettadelson.com/blogs/rbuckton/archive/2007/02/02/Skinning-model-for-Calendar-and-Tabs-in-Ajax-Control-Toolkit.aspx on the Tab Sample pagehttp://ajax.asp.net/ajaxtoolkit/Tabs/Tabs.aspx is dead anyone know where this documentation is as I'm using the Tab control and need to modify the css a bit
any help welcome I've been looking for this for about two weeks and the URL is still dead so I'm hoping someone made a copy to word etc.
Regards
Steve
Hi Steve,
This content in the link is now included inhttp://ajax.asp.net/ajaxtoolkit/Tabs/Tabs.aspx now.
Hello Raymond, I needs documentation about the tabs methods for the clientside. Please, can you help me with that? because I needs create a news tabs in clientside with javascript.
Greetings and thanks!
You can take a look into the source code of it. Corresponding client side functions can be found in tabs.js file.
My rough idea is that you instantiate a AjaxControlToolkit.TabPanel object and add it into the AjaxControlToolkit.TabContainer's _tabs array.
Thanks Raymond, but in the tabs.js file I can't found the method to add a new Tab. Please, can you write me some example code to create a Tab object and add this in a tabs collection?
Thanks again, and I waiting for your help!
The method used to add tab to a tabContainer is this:
$create(AjaxControlToolkit.TabPanel, {"headerTab":$get("__tab_TabContainer1_p2")}, null, {"owner":"TabContainer1"}, $get("TabContainer1_p2"));
And you need to create element with the above IDs. You can refer to the generated page's source to find out what should those elements should be like.
tab control
Hey,
I believe the tabcontainer has an SelectedIndex or ActiveIndex property, or something similar, which contains the index of the active tab.
Tab Control
Does anyone know how to make the tabs on a TabControl that comes with the Ajax control toolkit to display its tabs on multiple rows and not just on one long row?
Thanks in advance
your're not the only one... vote here!
http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=8843
Cheers!
Thanks. Hope we get the feature Soon!
Tab Control
How do I change Tab Panel BackColor?
Refer to the link below, hope that will help
http://community.bennettadelson.com/blogs/rbuckton/archive/2007/02/02/Skinning-model-for-Calendar-and-Tabs-in-Ajax-Control-Toolkit.aspx
Tab Control - AjaxControlToolkit
Hi All,
I am using Tab control in asp.net ajax. I have two tabs and each tab has a gridview. Both the gridview is binded to Datasource, both has paging but only one grid paging is working the other one is not working.
Even the second grid paging event is fired, new dataset is binded to the grid but it is not reflected in the grid.
Why is this?
Any one has any idea on this?
Regards,
Techwork.
Hi All,
I found out soem what the cause for that but could not find the reason for that.
I am using the Active Tab Changed event to bind the grid whenever the postback happens, but the event is not getting fired in some cases.
If that event fires properly my issues are solved.
I used the clientside event to fire the server side event but no use, in that case Active Tab Changed event is not getting fired at any time.
I am creating the tab control dynamically, will that be a problem.
Same I tried by creating statically it is working.
regards,
Santha