Tree View Control
-
Hi, I am using Tree view control for navigation. I am using XmlDataSource control as the datasource for the tree view control. I have given below the Xml file content. <?xml version="1.0" encoding="utf-8" ?> <Countries> <continent cont="NorthAmerica" Navigate="Header.aspx"> <country coun="United States of America"> <language lang="English"></language> <capital cap="Washington D.C"></capital> <cities city="Chicago"></cities> </country> </continent> <continent cont="Europe"> <country coun="United Kingdom"> <language lang=" English"></language> <capital cap="London"></capital> <cities city="Bristol"></cities> </country> </continent> </Countries> Html source: <asp:TreeView ID="LeftNavigation" runat="server" DataSourceID="XmlDataSource1"> <DataBindings> <asp:TreeNodeBinding DataMember="Countries" Text="Countries" NavigateUrlField="Navigate" /> <asp:TreeNodeBinding DataMember="continent" TextField="cont"/> <asp:TreeNodeBinding DataMember="country" TextField="coun" /> <asp:TreeNodeBinding DataMember="language" TextField="lang" /> <asp:TreeNodeBinding DataMember="captial" TextField="cap" /> <asp:TreeNodeBinding DataMember="cities" TextField="city" /> </DataBindings> </asp:TreeView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource> Here the binding working fine. But the navigation is not working. I have given the NavigateUrlField="Navigate". "Navigate" is having the url in xml file. Giving the binding error @ runtime. Pls help me! Tnx.
-
Hi, I am using Tree view control for navigation. I am using XmlDataSource control as the datasource for the tree view control. I have given below the Xml file content. <?xml version="1.0" encoding="utf-8" ?> <Countries> <continent cont="NorthAmerica" Navigate="Header.aspx"> <country coun="United States of America"> <language lang="English"></language> <capital cap="Washington D.C"></capital> <cities city="Chicago"></cities> </country> </continent> <continent cont="Europe"> <country coun="United Kingdom"> <language lang=" English"></language> <capital cap="London"></capital> <cities city="Bristol"></cities> </country> </continent> </Countries> Html source: <asp:TreeView ID="LeftNavigation" runat="server" DataSourceID="XmlDataSource1"> <DataBindings> <asp:TreeNodeBinding DataMember="Countries" Text="Countries" NavigateUrlField="Navigate" /> <asp:TreeNodeBinding DataMember="continent" TextField="cont"/> <asp:TreeNodeBinding DataMember="country" TextField="coun" /> <asp:TreeNodeBinding DataMember="language" TextField="lang" /> <asp:TreeNodeBinding DataMember="captial" TextField="cap" /> <asp:TreeNodeBinding DataMember="cities" TextField="city" /> </DataBindings> </asp:TreeView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource> Here the binding working fine. But the navigation is not working. I have given the NavigateUrlField="Navigate". "Navigate" is having the url in xml file. Giving the binding error @ runtime. Pls help me! Tnx.