\'ASP.default_aspx\'不包含\'DS_Filtering\'的定义,也没有扩展方法

问题描述

| 在default.aspx上启用“ 0”过滤事件后,出现以下错误。   \'ASP.default_aspx \'不包含   \'DS_Filtering \'的定义,否   扩展方法 我有什么想念的吗? 请帮忙     

解决方法

下面可能会告诉您这是如何工作的,请检查:
<html xmlns=\"http://www.w3.org/1999/xhtml\" >
    <head runat=\"server\">
    <title>ASP.NET Example</title>
</head>
<body>
        <form id=\"FORM1\" runat=\"server\">

            <p>Show all employees with the following title:
            <asp:DropDownList
                id=\"DropDownList1\"
                runat=\"server\"
                AutoPostBack=\"True\">
                <asp:ListItem>Sales Representative</asp:ListItem>
                <asp:ListItem>Sales Manager</asp:ListItem>
                <asp:ListItem>Vice President,Sales</asp:ListItem>
            </asp:DropDownList></p>

            <asp:SqlDataSource
                id=\"SqlDataSource1\"
                runat=\"server\"
                ConnectionString=\"<%$ ConnectionStrings:NorthwindConnection %>\"
                SelectCommand=\"SELECT EmployeeID,FirstName,LastName,Title FROM Employees\"
                FilterExpression=\"Title=\'{0}\'\" OnFiltering=\"SqlDataSource1_Filtering\">
                <FilterParameters>
                    <asp:ControlParameter Name=\"Title\" ControlId=\"DropDownList1\" PropertyName=\"SelectedValue\"/>
                </FilterParameters>
            </asp:SqlDataSource><br />

            <asp:GridView
                id=\"GridView1\"
                runat=\"server\"
                DataSourceID=\"SqlDataSource1\"
                AutoGenerateColumns=\"False\">
                <columns>
                    <asp:BoundField Visible=\"False\" DataField=\"EmployeeID\" />
                    <asp:BoundField HeaderText=\"First Name\" DataField=\"FirstName\" />
                    <asp:BoundField HeaderText=\"Last Name\" DataField=\"LastName\" />
                </columns>
            </asp:GridView>
                <asp:Label ID=\"Label1\" runat=\"server\" Text=\"Label\"></asp:Label>

        </form>
    </body>
</html> 
服务器端:
  protected void SqlDataSource1_Filtering(object sender,SqlDataSourceFilteringEventArgs e)
    {
        Label1.Text = e.ParameterValues[0].ToString();
    }
    

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...