<asp:QueryExtender ID="QueryExtender1" TargetControlID="LinqDataSource1" runat="server"> <asp:SearchExpression DataFields="CustomerID" SearchType="StartsWith"> <asp:ControlParameter ControlID="TextBox1" /> </asp:SearchExpression> </asp:QueryExtender>
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="QueryExtender.aspx.vb" Inherits="QueryExtender" %> <!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>ThaiCreate.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Search" /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="LinqDataSource1"> <Columns> <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" /> <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /> <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" /> <asp:BoundField DataField="CountryCode" HeaderText="CountryCode" SortExpression="CountryCode" /> <asp:BoundField DataField="Budget" HeaderText="Budget" SortExpression="Budget" /> <asp:BoundField DataField="Used" HeaderText="Used" SortExpression="Used" /> </Columns> </asp:GridView> <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="mtDataClassesDataContext" EntityTypeName="" TableName="customers"> </asp:LinqDataSource> <asp:QueryExtender ID="QueryExtender1" TargetControlID="LinqDataSource1" runat="server"> <asp:SearchExpression DataFields="CustomerID" SearchType="StartsWith"> <asp:ControlParameter ControlID="TextBox1" /> </asp:SearchExpression> </asp:QueryExtender> </div> </form> </body> </html>
<asp:QueryExtender EnableViewState="True|False" ID="string" OnDataBinding="DataBiding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="UnLoad event hadler" Runat="server" TargetControlID="string" Visible="True|False" > <asp:ControlFilterExpression ControlD="string" Column="string"> </asp:ControlFilterExpression> <asp:DynamicFilterExpression ControlD="string" </asp:DynamicFilterExpression> <asp:CustomExpression="string" OnQuerying="OnQerying event handler"> </asp:CustomExpression> <asp:OrderByExpression="string" DataField="string" Direction="string"> <asp:ThenByExpression DataField="string" Direction="string" </asp:ThenBy> </asp:OrderByExpression> <asp:PropertyExpression="string"> <!-- child controls --> </asp:PropertyExpression > <asp:RangeExpression="integer" Datafield="string" MaxType="Exclusive|Inclusive|None" MinType="Exclusive|Inclusive|None"> <!--child controls--> </asp:RangeExpression> <asp:SearchExpression="string" ComparisonType="CurrentCulture|CurrentCultureIgnoreCase| InavariantCulture|InvariantCultureIgnoreCase| Ordinal|OrdinalIgnoreCase" DataField="string" SearchType="Contains|EndsWith|StartsWith"> <!--child controls--> </asp:SearchExpression> </asp:QueryExtender>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท