XML File : XMLFile1.xml |
<?xml version="1.0" encoding="utf-16"?> <書店> <電腦工具書> <books title="ASP.NET 4.0網站開發實戰" author="趙敏翔 悅知文化"/> <books title="LINUX 實戰手冊:入門.管理.架站" author="施威銘研究室 旗標出版股份有限公司"/> <books title="Microsoft Windows Server 2008架站實務" author="施威銘研究室 旗標出版股份有限公司"/> </電腦工具書> <人物傳記> <books title="伊達政宗" author="古木 漢湘文化事業股份有限公司"/> </人物傳記> </書店> |
ASPX File : default.aspx |
<asp:xmldatasource id="XmlDataSource1" runat="server" datafile="XMLFile1.xml" /> <asp:TreeView id="TreeView1" runat="server" datasourceid="XmlDataSource1"> <databindings> <asp:treenodebinding datamember="books" textfield="title"/> </databindings> </asp:TreeView> |