Welcome Guest Search | Active Topics | Sign In | Register

eo:Menu bound to SiteMapDataSource with images Options
AndyKowal
Posted: Friday, February 22, 2008 9:07:15 AM
Rank: Newbie
Groups: Member

Joined: 1/15/2008
Posts: 8
Hello,

I scoured the documentation and support forum but have not found the answer yet. I have a Menu bound to a SiteMapDataSource. In my web.sitemap file I want to specify left and/or right images for certain menu items. I have set the ImageBaseDirectory, but I can't figure out how to configure the binding for the imageUrl property in siteMapNodes.

Thanks in advance for your help!
Andy
eo_support
Posted: Friday, February 22, 2008 9:17:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi Andy,

You will need to handle ItemDataBound to do that. That event is called after each menu item is created from the data source. Inside your ItemDataBound event handler, you can cast the menu's DataItem to a SiteMapNode object:

SiteMapNode currentSiteMapNode = (SiteMapNode)Menu1.DataItem;

Or

Dim currentSiteMapNode as SiteMapNode = CType(Menu1.DataItem, SiteMapNode)

You can then modified the newly created item based on your SiteMapNode object.

Thanks
AndyKowal
Posted: Friday, February 22, 2008 9:44:56 AM
Rank: Newbie
Groups: Member

Joined: 1/15/2008
Posts: 8
Got it. Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.