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
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
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
|
Rank: Newbie Groups: Member
Joined: 1/15/2008 Posts: 8
|
Got it. Thanks!
|