Solved

Linking to data within a sibling AJAX tab

Posted on 2007-11-29
2
333 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 250 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

742 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