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)?
TRINAKRIAE
Member
211 Points
147 Posts
How to programmatically get the DataNavigateUrlFields property from a HyperLinkField control
Mar 01, 2012 12:21 PM|LINK
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)?