QueryExtender Class Usage

February 10, 2010 at 6:57 PM

One of the class that being introduce in ASP.NET 4, QueryExtender.

QueryExtender play the role to filtered data that load from the data source without specify the WHERE clause.

It can control can be use in specifying filtering declarative syntax.

Example:

<asp:LinqDataSource ID="dataSource" runat="server"
    TableName="Products">
</asp:LinqDataSource>
<asp:QueryExtender TargetControlID="dataSource" runat="server">
  <asp:SearchExpression DataFields="ProductName, Supplier.CompanyName"
        SearchType="StartsWith">
    <asp:ControlParameter ControlID="TextBoxSearch" />
  </asp:SearchExpression>
</asp:QueryExtender>

Posted in: Technical Stuff

Tags: , ,