how to exclude root node in XML for displaying menu?
I want to atta开发者_C百科ch the xml file data to the menu through the XmlDataSource. I did that but it display from root node. How to do if do not want root node menu. & all the sub menus in same level. eg File, Edit, View etc. Because not to do so then we get unnecessary one extra level for root level menu.
Regards, Girish
Use the XmlDataSource.XPath property to specify the entry point to the data you want to show for example
XmlDataSource.XPath = "xml/submenus";
Modify the XPath to point to the correct tags in the xml file.
ASPX:
XPATH="ROOT/TARGET"
XML:
<ROOT>
<TARGET TEXT="STARTS HERE">
<DATA TEXT="OTHER DATA HERE" />
</TARGET>
</ROOT>
精彩评论