*******************Dome3.aspx
书名:<asp:DropDownList ID="DropDownList1"
runat="server" Height="28px" Width="136px">
</asp:DropDownList>
*******************Dome3.aspx.cs
public partial class Dome3 : System.Web.UI.Page
{
XmlDocument xdoc;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
xdoc = new XmlDocument();
xdoc.Load(Server.MapPath("books.xml"));
XmlNodeList list = xdoc.GetElementsByTagName("name");
foreach (XmlNode node in list)
{
this.DropDownList1.Items.Add(node.InnerText);
}
}
}