troubleshooting Question

How to append a variable value to grid view link

Avatar of davnhm
davnhmFlag for Afghanistan asked on
ASP.NETVisual Basic.NET
5 Comments1 Solution371 ViewsLast Modified:
HI

I am trying to add an extra parameter to the  DataNavigateUrlFormatString of a grid view. The value is held in a code behind variable, qID

I have tried a databound event, but it doesn't seem to be firing. Can someone tell me what I am doing wrong?

 Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs)

        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim h As HyperLinkField = DirectCast(GridView1.Columns(5), HyperLinkField)
            h.DataNavigateUrlFormatString += "&pid=" + qID
        End If
        If e.Row.RowType = DataControlRowType.Footer Then
        End If
    End Sub
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros