<%@ Page Language="vb" AutoEventWireup="false" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.IO" %>
<html>
<head>
<script language="vb" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim fs As FileStream = New FileStream(Server.MapPath("magazzino.xml"), FileMode.Open, FileAccess.Read)
Dim sr As StreamReader = New StreamReader(fs)
Dim ds As DataSet = New DataSet
ds.ReadXml(sr)
fs.Close()
If (Not Page.IsPostBack) Then
DL.DataSource = ds.Tables(0).DefaultView
DL.DataBind()
Else
Dim dv As DataView = New DataView(ds.Tables(0))
dv.RowFilter = "au_id='" & DL.SelectedItem.Text & "'"
DG.DataSource = dv
DG.DataBind()
End If
End Sub
</script>
</head>
<body>
<form id="Form1" method="post" runat="server">
<asp:DropDownList DataTextField="nome"
AutoPostBack=true DataValueField="quantita" Runat="server" id="DL" />
<asp:DataGrid id="DG" Runat="server" />
</form>
</body>
</html>