Solved

Set Tab Index on Gridviw Linkbutton Click

Posted on 2013-10-24
2
450 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp day pilot 3 19
VB.net Move a class from Solution Items to a project 2 22
No Data for DropDown List 2 25
location of a form 2 14
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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