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

<!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 ID="LinqDataSource1" runat="server" ContextTypeName="NorthwindDataContext"
            EntityTypeName="" Select="new (ProductName, QuantityPerUnit, UnitPrice, UnitsInStock)"
            TableName="Products" Where="ProductName == @ProductName">
            <WhereParameters>
                <asp:RouteParameter Name="ProductName" RouteKey="NomeProduto" Type="String" />
            </WhereParameters>
        </asp:LinqDataSource>

        <asp:DetailsView ID="dvProdutos" DataSourceID="LinqDataSource1" runat="server" 
            AutoGenerateRows="False">
            <Fields>
                <asp:BoundField DataField="ProductName" HeaderText="ProductName" 
                    ReadOnly="True" SortExpression="ProductName" />
                <asp:BoundField DataField="QuantityPerUnit" HeaderText="QuantityPerUnit" 
                    ReadOnly="True" SortExpression="QuantityPerUnit" />
                <asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice" ReadOnly="True" 
                    SortExpression="UnitPrice" />
                <asp:BoundField DataField="UnitsInStock" HeaderText="UnitsInStock" 
                    ReadOnly="True" SortExpression="UnitsInStock" />
            </Fields>
        </asp:DetailsView>
        <br />
    </div>
    <asp:HyperLink ID="HyperLink1" NavigateUrl="http://localhost/Capitulo11/Produtos/Pavlova" runat="server">Produtos</asp:HyperLink>
    </form>
</body>
</html>
