Hi,
You won't be able to do it this way. When you bind the menu to a SiteMapDataSource, the "data item" is a SiteMapNode object. It is not an XmlNode. So syntax like "@title" does not work.
There are two ways to resolve this issue:
1. Instead of setting the menu's DataSourceID, set the menu's XmlFile directly to the name of your site map file. This way the menu will use the XML based logic to populate. That way it should correctly interpret "@title", "@image_URL" correctly;
2. Still use DataSourceID, but handle the menu's ItemDataBound event and use the following code to explicitly read "image-URL" from the site map file and set the menu item's Image.Url based on it:
Code: C#
protected void Menu1_ItemDataBound(
object sender, EO.Web.NavigationItemEventArgs e)
{
SiteMapNode node = (SiteMapNode)Menu1.DataItem;
string imageUrl = node["image-URL"];
e.MenuItem.Image.Url = imageUrl;
}
Hope this helps. Please feel free to let us know if you have any more questions.
Thanks!