Could someone please help me understand what I am doing wrong. I have tried endlessly trying to get this to work.
All I get is errors.
Thank you.
Here is what I want to do:
I have a gridview with a hyperlink field. I want to set the DataNavigateUrlFormatString with a function call while passing it a parameter thus building a proper hyperlink.
Here is the hyperlink:
<asp:HyperLinkField DataNavigateUrlFields="Account" DataTextField="AccountName" HeaderText="Account" DataNavigateUrlFormatString='<%# GetURL(account={0}) %>'>
</asp:HyperLinkField>
and here is my function:
Public Function GetURL(ByVal userAccount As String) As String
Dim strReturn As String = ConfigurationManager.AppSettings
("PortalProfileURL").ToString & "'" & userAccount & "'"
Return strReturn
End Function
All I get is errors.
Thank you.
Here is what I want to do:
I have a gridview with a hyperlink field. I want to set the DataNavigateUrlFormatString with a function call while passing it a parameter thus building a proper hyperlink.
Here is the hyperlink:
<asp:HyperLinkField DataNavigateUrlFields="Account" DataTextField="AccountName" HeaderText="Account" DataNavigateUrlFormatString='<%# GetURL(account={0}) %>'>
</asp:HyperLinkField>
and here is my function:
Public Function GetURL(ByVal userAccount As String) As String
Dim strReturn As String = ConfigurationManager.AppSettings
("PortalProfileURL").ToString & "'" & userAccount & "'"
Return strReturn
End Function