asp.net.ph

HyperLinkColumn.DataNavigateUrlField Property

System.Web.UI.WebControls Namespace   HyperLinkColumn Class


Sets or retrieves the field from a data source to bind to the URL of the hyperlinks in the column.

Syntax


Inline <asp:hyperlinkcolumn datanavigateurlfield = strFieldName ... >
Script HyperLinkColumn.DataNavigateUrlField = strFieldName

Property Value


strFieldName String specifying the name of a field from the data source to bind to the URL of the hyperlinks in the column.

The property is read/write with no default value.

Remarks

Use the DataNavigateUrlField property to specify the field from a data source to bind to the URL of the hyperlinks in the column. When the URL is data bound to a field, the URL of each hyperlink in the column is set with a corresponding value in the specified field. This allows you to set a different URL for each hyperlink in the column. To specify the same URL for each row in the column, set the NavigateUrl property instead of this property.

NOTE: The DataNavigateUrlField and NavigateUrl properties cannot both be set at the same time. If both properties are set, the DataNavigateUrlField property takes precedence.

When you are using data binding, you can specify a custom display format for the URL of the hyperlinks by setting the DataNavigateUrlFormatString property.

Example

The following example demonstrates how to use the DataNavigateUrlField property to specify the field in a data source to bind to the URL of the hyperlinks in the column.

<asp:hyperlinkcolumn headertext = "Title"
   datatextfield = "title"
   datanavigateurlformatstring = "details_title.aspx?titleid={0}"
   datanavigateurlfield = "title_id" />

 Show me 

See Also

HyperLinkColumn Members   Adding HyperLink Columns to a DataGrid Control Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph