Showing posts with label current. Show all posts
Showing posts with label current. Show all posts

Wednesday, March 28, 2012

Tab Container doubts

Hi,

I have two questions regarding the Tab Container Control:

1) How can I get the current Tab in the code behind ?

2) if I have five tabpanels, with one grid view on each one and I want to use the updatepanel.

should I create one updatepanel and place all the tabpanels on it, or create one updatepanel for each tabpanel ?

Thanks !

I haven't tried your Tab / Update Panel combinations, but getting the current TabIndex in your server code is easy.

Dim TabNoAsInteger

TabNo = TabContainer1.ActiveTabIndex

Remember Active.TabIndex is Zero based so if you have 4 tabes and the last one is selected, the active index will be "3"


Hi,

Personally, I'd place different UpdatePanel for each tab. Haven't done this ever too, you may have a try and know if it works.


The Tab / Update panel combination worked smothly by using a diferent updatepanel for each tabpanel, like Raymond suggested.

If you want, you can use an update progress like this:

<asp:UpdateProgressID="UpdateProgress1"runat="server"AssociatedUpdatePanelID="Tabs$Panel1$upd1">

Thanks Joe and Raymond,

Skynyrd

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

Saturday, March 24, 2012

TabContainer & TabPanel bug?

On click of a tab, I validate the current tab. If the validation fails, is there a way to keep the current tab selected? I've tried using theActiveTabChangedfunction, but it never goes into the code.

Does anyone know how to select a tab with javascript?

One other thing, when you wrap a TabContainer in an UpdatePanel you get javascript error mesasge when use ajax call within the tab, so this seems to be an issue.

Hi,

Please try this to select a tab
function change() {
??????$find('TabContainer1').set_activeTabIndex(1);
}

Can you show me a small demo about?the?second question ?

TabContainer and FormView

Hello,

I would like to replace our current tab solution with the tab controls found in the ajax control toolkit. I've spent a few days trying to get the tabs to operate in the manner I would like and was wondering if anyone could explain the best way to use TabContainer and FormView controls together.

Basically, I would like to do the following:
<asp:SqlDataSource ... /><asp:FormView ...><EditItemTemplate><ajaxToolkit:TabContainer ...><ajaxToolkit:TabPanel ID="Panel1" ...>...</ajaxToolkit:TabPanel><ajaxToolkit:TabPanel ID="Panel2" ...>...</ajaxToolkit:TabPanel></ajaxToolkit:TabContainer></EditItemTemplate></asp:FormView>

When I build pages based on this - Update and Insert commands fail with "You must declare the scalar variable XXX" errors as the formview cannot find the editing controls inside the TabContainer because it is an INamingContainer. I have tried using multiple FormView controls (one for each tab panel) in concert to update & insert records - however the amount of custom code required is unacceptable.

The solution I choose has to be very reusable as we have hundreds of different pages (like this) in production. At this point I am considering writing my own client side tab control as I would like to come up with a solution as quickly as possible and I've hit a number of dead ends.

Does the ajax control toolkit support using a FormView that contains a TabContainer (am I just missing something)? Are there any good workarounds? Are there plans to add this kind of support in the future?

Any answers or information will greatly help me make my decisions. Thanks in advance,
J. Shane Kunkle

jkunkle@dotnet.itags.org.vt.edu

Any input or advice is appreciated...

Hi Shane,

I think it's not that easy to make works perfectly in your situation now.

Can you try to add a public property on the TabContainer, and take it as a parameter?


I'm sorry - i'm not sure i understand your advice. Are you advising that I should create a class that inherits from TabContainer - what would the new property do?

Thanks again for the assistance,

Shane


Yes, or you can change the its original code since it's provided.