?
Solved

Linking to data within a sibling AJAX tab

Posted on 2007-11-29
2
Medium Priority
?
339 Views
Last Modified: 2013-11-26
I have setup a page using tabs from the ASP.NET Ajax Toolkit. One requirement is for a hyperlink on one tab on the page to redirect the user to data appearing on another non-defaulted tab of that page. Is there a way to do this? Here's the code:

 <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">

            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
                <ContentTemplate>
                    <a href="???">Click here to view your data</a>
                </ContentTemplate>
            </cc1:TabPanel>

            <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
                <ContentTemplate>
                    Target Data user is looking for ...
                </ContentTemplate>
            </cc1:TabPanel>

        </cc1:TabContainer>

I want to place a link on tab panel 1 that points to data within tab panel 2. What I need to know is what to put in place of "???".

Thanks.
0
Comment
Question by:CaptCredence
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Infinite_Recursion earned 750 total points
ID: 20377495
function setActiveTab(tabNumber)
   {
        var ctrl = $find('<%=TabContainer.ClientID%>');
        ctrl.set_activeTab(ctrl.get_tabs()[tabNumber]);                  
   }

this is a function that sets the active tab using javascript so you just set the anchor's href to look like this:
<a href='setActiveTab(1)'>Go to Next Tab</a>;
referenced from:
http://forums.asp.net/p/1098533/1666430.aspx
0
 

Author Comment

by:CaptCredence
ID: 20407283
The javascript didn't work for me, but after digesting the article, here's what I ended up using:

On the client:
 <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">

            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
                <ContentTemplate>
                     <asp:LinkButton ID="lbtnSecondaryData" runat="server"
                          Text='Click here for secondary data' OnClick="lbtnSecondaryData_Click" />
               </ContentTemplate>
            </cc1:TabPanel>

            <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
                <ContentTemplate>
                    Secondary Data user is looking for ...
                </ContentTemplate>
            </cc1:TabPanel>

        </cc1:TabContainer>


On the server:
        protected void lbtnSecondaryData_Click(object sender, EventArgs e)
        {
            TabContainer1.ActiveTabIndex = 1;       // Make the Secondary tab active and appear
        }
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question