In my ASP.NET Page_load I have this code:
SiteMenu.DataSource = new XmlDataSource(); ((XmlDataSource)SiteMenu.DataSource).ID = "menu"; ((XmlDataSource)Si开发者_如何学PythonteMenu.DataSource).Data = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><siteMap> <siteMapNode title=\"default\" description=\"my title\" url=\"http://www.google.com\"/></siteMap>"; SiteMenu.DataBind();
Where SiteMenu is an Asp:menu control. But for some reason I'm getting a menu with one element with name "siteMap" and a child element with name "siteMapNode".
I would like to have only one element (rappresented by the ) with title "default". Any Idea of what I'm doing wrong?
精彩评论