Retrieves the navigation item at the specified ItemID path.
Parameters
-
path
- The ItemID path to the returned navigation item.
Return Value
A NavigationItem object that represents the navigation item at the specified ID path, or null if no matching navigation item is found.
Remarks
FindItem method is used to retrieve a NavigationItem object at the specified path. The value path for a navigation item is a delimited list of items' ItemID property value that forms a path from the root navigation item to the current navigation item. To determine the delimiter character, use the PathSeparator property.
[C#] // Declare the ID path to the Dessert menu item using
// the delimiter character specified in the PathSeparator
// property. In this example, the delimiter character is the default
// value - slash. Note that you can not specify "/" in any of your menu item's ID.
String valuePath= @"Home/Food/Dessert";
// Use the FindItem method to get the Classical navigation item using
// its ID path.
EO.Web.MenuItem item = (EO.Web.MenuItem)MyMenu.FindItem(valuePath);
//Indicate whether the navigation item was found.
if (item != null)
{
Message.Text = "Menu item found.";
}
else
{
Message.Text = "Menu item not found.";
}
[Visual Basic.NET] ' Declare the ID path to the Dessert menu item using
' the delimiter character specified in the PathSeparator
' property. In this example, the delimiter character is the default
' value - slash. Note that you can not specify "/" in any of your
' menu item's ID.
Dim valuePath As String = "Home/Food/Dessert"
' Use the FindItem method to get the Classical menu item using
' its ID path.
Dim item As EO.Web.MenuItem = CType(MyMenu.FindItem(valuePath), EO.Web.MenuItem)
' Indicate whether the menu item was found.
If Not item Is Nothing Then
Message.Text = "Menu item found. "
Else
Message.Text = "Menu item not found."
End If
See Also
BaseNavigator Class | EO.Web Namespace