Skip to main content
Tab

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.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue("")]
public string NavigateUrlField { get; set; }

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.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" 
Inherits="_Default" %>

<%@ Register assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTabControl" tagprefix="dxtc" %>
<%@ Register assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dxw" %>
<%@ Register assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxCallbackPanel" tagprefix="dxcp" %>
<%@ Register assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dxp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <dxtc:ASPxTabControl ID="ASPxTabControl1" runat="server" 
            DataSourceID="XmlDataSource1" NavigateUrlField="id" NavigateUrlFormatString="?id={0}">
        </dxtc:ASPxTabControl>
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" 
            DataFile="~/App_Data/TabControlData.xml" XPath="//product">
        </asp:XmlDataSource>
    </div>
    </form>
</body>
</html>
See Also