<div>
<table>
<tr><td colspan=2>书名<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="显示详细信息" Xοnclick="Button1_Click" /></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox5" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox6" runat="server"></asp:TextBox></td></tr>
<table>
<tr><td colspan=2>书名<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="显示详细信息" Xοnclick="Button1_Click" /></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox5" runat="server"></asp:TextBox></td></tr>
<tr><td>作者</td> <td><asp:TextBox ID="TextBox6" runat="server"></asp:TextBox></td></tr>
</table>
</div>
XmlNode node= xdoc.DocumentElement.SelectSingleNode("book[name='" + DropDownList1.Text + "']");
foreach (XmlNode item in node.ChildNodes)
{
if (item.LocalName == "author")
{
this.TextBox1.Text = item.InnerText;
}
if (item.LocalName == "publisher")
{
this.TextBox2.Text = item.InnerText;
}
if (item.LocalName == "date")
{
this.TextBox3.Text = item.InnerText;
}
if (item.LocalName == "name")
{
this.TextBox4.Text = item.InnerText;
}
if (item.LocalName == "isbn")
{
this.TextBox5.Text = item.InnerText;
}
if (item.LocalName == "price")
{
this.TextBox6.Text = item.InnerText;
}
}