Hello,
I am trying to add Ajax Tabcontainer to my webpage, and stuck in mid way with some issues during implementation.
Here is what is done so far:
1. I have a webapage with Tabcontainer1 with 4 tab panels(lets say TabPanel 1-4).
2. Since Tabpanel need to list same kind of form template, I have created a user Control(uc1) which is in turn has a TabContainer2 with 4 tabpanels(lets say TabPanel 5-8).
3. Now I use this uc1 in each of the tabpanels in my TabContainer1.
<asp:ScriptManager runat="server"></asp:ScriptManager>
<ajaxtoolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" AutoPostBack="true" OnActiveTabChanged="Tabs_ActiveTabChanged">
<ajaxtoolkit:TabPanel runat="server" HeaderText="Week-2" ID="TabPanel1" >
<ContentTemplate>
<uc1:Assessment_View ID ="ViewContainer1" runat="server" />
</ContentTemplate>
</ajaxtoolkit:TabPanel>
<ajaxtoolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Week0">
<ContentTemplate>
<uc1:Assessment_View ID ="ViewContainer2" runat="server" />
</ContentTemplate>
</ajaxtoolkit:TabPanel>
<ajaxtoolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="Week3">
<ContentTemplate>
<uc1:Assessment_View ID ="ViewContainer3" runat="server" />
</ContentTemplate>
</ajaxtoolkit:TabPanel>
<ajaxtoolkit:TabPanel ID="TabPanel4" runat="server" HeaderText="Week6">
<ContentTemplate>
<uc1:Assessment_View ID ="ViewContainer4" runat="server" />
</ContentTemplate>
</ajaxtoolkit:TabPanel>
</ajaxtoolkit:TabContainer>
Issues :
1. TabPanel 5(View Data form) in uc1 has to load the data from Db depending on the week Selected in TabContainer1(WeekNo), but doesn't load data on pageload, but once I click on some other tab(6-8) and come back to tabPanel5, the data gets loaded as expected
as I have the TabChanged event to take care of it.
Solutions tried:
I tried to load the data in page load event of uc1, depending on the Tab selected in tabContainer1, but i see that the pageload of uc1 gets hit first and then the TabChangedevent of TabContainer1, where as I am setting the weekNo in TabChangedevent of Tabcontainer1.Hence
it doesnt bind the correct week data.
2. Button event in TabPanel 6(Its like a form with text boxes with Submit button) in uc1 does not get fired.
Solution tried:
If I disable the validation by setting the CausesValidation as false for the button, event gets fired.
Please help me solve both of these issues.
Thanks for looking into this.