ASPxTabControl.NavigateUrlField Property
Gets or sets the name of a data field (or an xml element’s attribute) which provides tab navigation locations.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
String | String.Empty | A string value that specifies the name of the required data source field. |
Remarks
The NavigateUrlField property is in effect if the ASPxTabControl control is bound to a data source (via the ASPxDataWebControlBase.DataSourceID or ASPxDataWebControlBase.DataSource property).
Use the NavigateUrlField property to specify the bound data source’s data field (or an xml element’s attribute) which stores tabs’ navigate URLs. The NavigateUrlField property maps the Tab.NavigateUrl properties of Tab objects to the specified data field’s values.
You can format the obtained navigate locations by using the ASPxTabControl.NavigateUrlFormatString property.
If the NavigateUrlField property of a data bound ASPxTabControl control is not defined, the control can automatically obtain tab navigate URLs from a data field whose name is “NavigateUrl” (which is equal to the Tab.NavigateUrl property’s name). You can also handle the ASPxTabControl.TabDataBound event to manipulate a tab’s settings, as required.
Example
This example illustrates how the ASPxTabControl can be bound to the XmlDataSource component that obtains data from an xml file. The ASPxTabControl implements specific properties that point to the data fields containing the necessary data. These are the ASPxTabControl.NameField, ASPxTabControl.NavigateUrlField
, ASPxTabControl.TabImageUrlField, ASPxTabControl.ActiveTabImageUrlField, ASPxTabControl.TextField and ASPxTabControl.ToolTipField properties. If these properties are not defined, the ASPxTabControl is able to automatically bind to data fields whose names coincide with the property names of a Tab object (such as the TabBase.Name, Tab.NavigateUrl, TabBase.TabImage, TabBase.ActiveTabImage, TabBase.Text and TabBase.ToolTip).
In this demo, navigate locations for tabs are composed by formatting values of the ‘id’ data field in a specific manner. The ‘id’ data field is pointed by the ASPxTabControl.NavigateUrlField
property, and a format string is defined via the ASPxTabControl.NavigateUrlFormatString property.
<dx:ASPxTabControl ID="ASPxTabControl1" runat="server"
DataSourceID="XmlDataSource1" NavigateUrlField="id" NavigateUrlFormatString="?id={0}">
</dx:ASPxTabControl>
<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="~/App_Data/TabControlData.xml" XPath="//product">
</asp:XmlDataSource>