Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Linking to data within a sibling AJAX tab

Posted on 2007-11-29
2
Medium Priority
?
343 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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