How to use SqlDataSource FilterExpression in asp.net

SqlDataSource FilterParameters and FilterExpression
FilterParametersExample.aspx

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

<!DOCTYPE html>

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>asp.net SqlDataSource example: using FilterParameters, FilterExpression</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Red">FilterParameters Example</h2>
        <asp:SqlDataSource
             ID="SqlDataSource1"
             runat="server"
             ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
             SelectCommand="SELECT ProductID, ProductName FROM Products"
             >
        </asp:SqlDataSource>
        <asp:DropDownList 
            ID="DropDownList1"
            runat="server"
            DataSourceID="SqlDataSource1"
            DataTextField="ProductName"
            DataValueField="ProductID"
            AutoPostBack="true"
            ForeColor="SeaGreen"
            BackColor="DarkGreen"
            >
        </asp:DropDownList>
        <asp:SqlDataSource 
            ID="SqlDataSource2"
            runat="server"
            ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="SELECT ProductID, ProductName, UnitPrice FROM Products"
            FilterExpression="ProductID='{0}'"
            >
            <FilterParameters>
                <asp:ControlParameter Name="ProductID" ControlID="DropDownList1" PropertyName="SelectedValue" />
            </FilterParameters>
        </asp:SqlDataSource>
        <br /><br />
        <asp:GridView 
            ID="GridView1"
            runat="server"
            DataSourceID="SqlDataSource2"
            HeaderStyle-BackColor="HotPink"
            HeaderStyle-ForeColor="AntiqueWhite"
            BorderColor="SaddleBrown"
            ForeColor="SeaGreen"
            >
        </asp:GridView>
    </div>
    </form>
</body>
</html>
More asp.net examples