<%@ Page Language="C#" %>

<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:LinqDataSource ContextTypeName="NorthwindDataContext" TableName="Customers"
            ID="LinqDataSource1" runat="server" Select="new(Country)">
        </asp:LinqDataSource>
        <asp:LinqDataSource ContextTypeName="NorthwindDataContext" TableName="Customers"
            ID="LinqDataSource2" runat="server" Select="new(CompanyName, City, Country)"
            Where='Country=@Pais' AutoGenerateOrderByClause="true">
            <WhereParameters>
                <asp:ControlParameter ControlID="DropDownList1" Name="Pais" DefaultValue="Brazil"
                    Type="String" />
            </WhereParameters>
            <OrderByParameters>
                <asp:ControlParameter ControlID="DropDownList3" Name="Order" Type="String" />
            </OrderByParameters>
        </asp:LinqDataSource>
        Filtro:
        <asp:DropDownList ID="DropDownList1" DataSourceID="LinqDataSource1" DataTextField="Country"
            DataValueField="Country" runat="server" AutoPostBack="True">
        </asp:DropDownList>
        &nbsp;Ordenar por: <asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True">
            <asp:ListItem Text="CompanyName" Value="CompanyName" />
            <asp:ListItem Text="City" Value="City" />
            <asp:ListItem Text="Country" Value="Country" />
        </asp:DropDownList>
        <asp:GridView ID="GridView1" runat="server" DataSourceID="LinqDataSource2">
        </asp:GridView>
    </div>
    </form>
</body>
</html>
