Hi,
I think you were not cleared about when you want value of Hyperlink...So i assumed it will either on gridview row data bound or Button click.
Protected Sub gvList_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvList.RowDataBound
If (e.Row.RowType = DataControlRowType.DataRow) Then
'Now you can get Hyperlink control with name ('HyperLink1') for current row, assumed it is on zero position (1st column of gridview)
Dim hlnk As HyperLink = CType(e.Row.FindControl("HyperLink1"), HyperLink)
Response.Write("<script>alert('Text: '" & hlnk.Text & "<br/>URL: " & hlnk.NavigateUrl & "');</script>")
End If
End Sub
Protected Sub btnGetValue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
For r As Integer = 0 To gvList.Rows.Count
'Now you can get Hyperlink control with name ('HyperLink1') for all row, assumed it is on zero position (1st column of gridview)
Dim hlnk As HyperLink = CType(gvList.Rows(r).FindControl("HyperLink1"), HyperLink)
Response.Write("<script>alert('Text: '" & hlnk.Text & "<br/>URL: " & hlnk.NavigateUrl & "');</script>")
Next
End Sub
I think this would be helpful :).
Thanks & Regards,
Imdad