Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7831543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:46:45+00:00 2026-06-02T11:46:45+00:00

Am trying to add to the navigation url in a hyperlink field. I have

  • 0

Am trying to add to the navigation url in a hyperlink field.

I have 5 columns on my gridview, the last being

  <asp:HyperLinkField DataNavigateUrlFields="vID" 
            DataNavigateUrlFormatString="Page2.aspx?field={0}" HeaderText="send" 
            Text="send"></asp:HyperLinkField>

and the code behind to add to it

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound

    Dim hk As HyperLink = DirectCast(e.Row.Cells(4).Controls(0), HyperLink)
    hk.NavigateUrl += "&TN=table1"

End Sub

I had it working yesterday, but must have accidentally deleted the code, and I cant find where am going wrong here, I get an error “Specified argument was out of the range of valid values.
Parameter name: index”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:46:47+00:00Added an answer on June 2, 2026 at 11:46 am

    You must check the RowType, otherwise you’re looking for the HyperLink also in the header.

    VB

    Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs )
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim link = DirectCast(e.Row.Cells(4).Controls(0), HyperLink)
            link.NavigateUrl &= "&TN=table1"
        End If
    End Sub
    

    C#

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HyperLink link = (HyperLink)e.Row.Cells[4].Controls[0];
            link.NavigateUrl += "&TN=table1";
        {
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tabbar controllor and trying to add navigation to each control. In
I am using Prism 2, trying to add four navigation buttons (First Record, Last
i'm trying to add some navigation arrows which allow the user to go to
I'm trying to add a navigational menu for my project which uses the ASP.NET
Trying to add a dynamic class value to one of my columns in CGridView:
using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In
I am trying to add a little animation with jQuery to my navigation bar.
I'm trying to add a reload button to my navigation bar using this code
I'm trying to either add 3 custom buttons to my navigation controller toolbar on
I have a asp.net MVC app and I'm trying to get the jqgrid 3.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.