• 【Asp.Net从零开始】:使用LinqToData与QueryExtender对数据进行筛选性输出


    <body>
        <form id="form1" runat="server">
        <div>
        
            演练链接:<a href="http://msdn.microsoft.com/zh-cn/library/dd537669">http://msdn.microsoft.com/zh-cn/library/dd537669</a></div>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="NORTHWNDDataContext" EntityTypeName="" TableName="Categories">
        </asp:LinqDataSource>
        <asp:QueryExtender ID="QueryExtender1" runat="server" 
            TargetControlID="LinqDataSource1">
            <asp:SearchExpression  SearchType="StartsWith" DataFields="CategoryName">
      <asp:ControlParameter ControlID="tb_search" />
    </asp:SearchExpression>
        </asp:QueryExtender>
        <br />
        SearchExpression指定匹配搜索:
        <asp:TextBox id="tb_search" runat="server" />
        <asp:Button Text="Search!" Id="button1" runat="server" />
        
    
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataKeyNames="CategoryID" 
            DataSourceID="LinqDataSource1">
            <Columns>
                <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" 
                    InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" />
                <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" 
                    SortExpression="CategoryName" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
            </Columns>
        </asp:GridView>
        
        
    
        </form>
    </body>
    

      

  • 相关阅读:
    NFS共享储存
    Rsync服务
    企业集群架构概述
    定时任务
    开机启动流程
    进程管理(二)
    linux系统管理-进程管理
    RAID&LVM有关磁盘的故障
    gdisk分区及swap分区
    操作系统与磁盘管理
  • 原文地址:https://www.cnblogs.com/VortexPiggy/p/2635948.html
Copyright © 2020-2023  润新知