In my ASP.NET Web Forms I would like to get the DataNavigateUrlFields from the HyperLinkField control.
In order to get the control I use the following code in the RowDataBound event:
If e.Row.Cells(n).Controls(0).GetType().ToString() = "System.Web.UI.WebControls.HyperLink" Then
Dim linkDownload As HyperLink = DirectCast(e.Row.Cells(n).Controls(0), HyperLink)
The problem is that I get an HyperLink already "filled" so the DataNavigateURLFormatString (myPage.aspx?downloadId = {0}) and DataNavigateUrlFields (downloadGuid) are already combined in the HyperLink.NavigateUrl property.
Is there any way to get the DataNavigateUrlFields property? In case there is not, is there any function to extract the downloadGuid value from HyperLink.NavigateUrl (in short treating the NavigateUrl as a QueryString)?
VB is preferred but also answers in C# are appreciated