Solved

Set Tab Index on Gridviw Linkbutton Click

Posted on 2013-10-24
2
444 Views
Last Modified: 2013-10-31
Hi

I have a gridview hyperlink field whci sets the ID in a quesrystring.

Rather than navigate to a new page I want it to stay on the same page but just display a different ajax tab.

TabContainer1.ActiveTab = TabContainer1.Tabs(5)

This code sets the querystring correctly.......

<asp:TemplateField>
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server" 
                                    NavigateUrl='<%# Eval("UserID", "RegisteredUsers.aspx?id={0}") %>' 
                        Text="More Details"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>

Open in new window


All I want to do is now display the different tab.

How can I access the Hyperlink1 click event programatically so I can set this everytime somone clicks on the hyperlink.

TabContainer1.ActiveTab = TabContainer1.Tabs(5)

Open in new window

0
Comment
Question by:edjones1
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39599242
You should be able to set the OnClick to an event handler in the code-behind in the HTML.

<asp:HyperLink ID="HyperLink1" runat="server"
                                    NavigateUrl='<%# Eval("UserID", "RegisteredUsers.aspx?id={0}") %>'
                        Text="More Details" OnClick="HyperLink_Click"></asp:HyperLink>
0
 

Author Closing Comment

by:edjones1
ID: 39613647
Perfect solution, thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now