Using Asp:menu and XmlDataSource

I've started to use  Asp:menu with XmlDataSource based on Quick Start Example.

To show many top level elements I tried to specify XPath, but failed to do it correctly(probably due to missing XML namespace).
So I changed the XML schema aa suggested in Asp.Net Menu Control Binding with XMLDataSource  and used XPath="/Home/Menu" to not show single root Item.

Unfortunately DataBinding doesn't support default properties in XML file.All nodes must have all attributes, specified in DataBinding  section.
Otherwise InvalidOperationException like the following will be shown:
Could not bind to the 'Selectable' property (specified by SelectableField) while databinding Menu. Please check the Bindings fields. 

It was a requirement to show top left menu item differently than other top menu.I was able conditionally specify first node of a few siblings using "Home/menu[1]|" Then I was about to use Templates and follow approach from Customise Individual Menu Items article .But suddenly I understood, that it is simpler to have left top menu as one control and other menus as second control with diferent behavior -KISS.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Wednesday, January 30, 2008 9:33 AM
Print

Comments on this entry:

# re: Using Asp:menu and XmlDataSource

Left by Sudhir at 6/3/2008 6:11 AM
Gravatar
Hi, I'm having the similar issue, where the first node should hide items if the session value is null, once the session value is filled, i wanted to start showing those items.
I have tried to do..but its not refreshing and holding the old items
you can read more http://forums.asp.net/p/1270093/2398020.aspx#2398020
can u share some thoughts on it

# re: Using Asp:menu and XmlDataSource

Left by SG at 7/30/2008 12:51 AM
Gravatar
view sol from www.xtremewebworld.net.

# re: Using Asp:menu and XmlDataSource

Left by XML Editor at 9/16/2010 3:46 AM
Gravatar
For troubleshooting these problems, check out various other XML software products on the market.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910