I have a gridview that is being populated from a datasouce.
The Stored procedure that is populating the datasource, has a field "Client" and a field "Client WebSite".
I want to populate the field "Client" in the gridview column called "Client" which would be a hyperlink field and the hyperlink field would be the "Client WebSite" value from the dataset. The client website is an external site (not within my asp project)
Below is my html code. How can I get the "Client WebSite" appear as the DataNavigatrURL value?
<asp:HyperLinkField DataTextField="Client" HeaderText="Client" DataNavigateUrlFields="Client"
DataNavigateUrlFormatString="Client WebSite">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Left" />
</asp:HyperLinkField>
Use databinding on the NavigateUrl attribute, like this:
Or more fully:
DataNavigateUrlFields
is used to gets or set the names of the fields from the data source used to construct the URLs for the hyperlinks in the HyperLinkField object.'DataNavigateUrlFormatString` is used to gets or sets the string that specifies the format in which the URLs for the hyperlinks in a HyperLinkField object are rendered.