zoukankan      html  css  js  c++  java
  • 【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>
    

      

  • 相关阅读:
    基于方便使用的所见即所得架构方式
    linux操作笔记
    TreeView获取目录下的所有文件
    treeList获取目录下的所有文件
    简单字符串处理 hdu2532 Engine
    简单字符串处理
    Luogu P1648 看守
    【深入理解Linux内核架构】第3章:内存管理
    【深入理解Linux内核架构】6.6 资源分配
    题解 P1888 【三角函数】
  • 原文地址:https://www.cnblogs.com/VortexPiggy/p/2635948.html
Copyright © 2011-2022 走看看