<%@ Page Language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Using XML Data Source::Simple</title>
</head>
<body>
<div id="pageContent">
<form id="form1" runat="server">
<asp:xmldatasource runat="server" ID="XmlDataSource1" DataFile="Data.xml" />
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1" />
</form>
</div>
</body>
</html>
File: Data.xml
<?xml version="1.0" standalone="yes"?>
<MyDataSet>
<NorthwindEmployees>
<Employee>
<employeeid>1</employeeid>
<lastname>D</lastname>
<firstname>N</firstname>
<title>Representative</title>
</Employee>
<Employee>
<employeeid>2</employeeid>
<lastname>Fill</lastname>
<firstname>Andrew</firstname>
<title>President</title>
</Employee>
<Employee>
<employeeid>3</employeeid>
<lastname>Lev</lastname>
<firstname>Janet</firstname>
<title>Sales</title>
</Employee>
</NorthwindEmployees>
</MyDataSet>
|