<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test_xml_ds1.aspx.cs" Inherits="test_xml_ds1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" DataSourceID="XmlDataSource1" AutoGenerateColumns="False">
            <Columns>
                <asp:BoundField DataField="nom" HeaderText="nom" SortExpression="nom" />
                <asp:BoundField DataField="adresse" HeaderText="adresse" SortExpression="adresse" />
                <asp:BoundField DataField="ville" HeaderText="ville" SortExpression="ville" />
                <asp:BoundField DataField="codepostal" HeaderText="codepostal" SortExpression="codepostal" />
                <asp:BoundField DataField="ouvert_samedi" HeaderText="ouvert_samedi" SortExpression="ouvert_samedi" />
                <asp:BoundField DataField="id_agence" HeaderText="id_agence" SortExpression="id_agence" />
            </Columns>
        </asp:GridView>
        <br />
        Rechercher une agence par code postal :        
        <select>
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="XmlDataSource1">
            <ItemTemplate>            
            <option value='<%# XPath("@id_agence") %>'><%# XPath("@codepostal") %></option>            
            </ItemTemplate>
        </asp:Repeater>
        </select>
        <br />
        
        
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/agences.xml" TransformFile="~/agences.xsl" XPath='//agence[@ouvert_samedi="true"]'>
        </asp:XmlDataSource>
        &nbsp;</div>
    </form>
</body>
</html>
