Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 当前上下文中不存在名称“AjaxControlToolkit”_Asp.net_Wcf - Fatal编程技术网

Asp.net 当前上下文中不存在名称“AjaxControlToolkit”

Asp.net 当前上下文中不存在名称“AjaxControlToolkit”,asp.net,wcf,Asp.net,Wcf,此代码是在wcf Service1.svc.cs中编写的 using System; using System.Configuration; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web;

此代码是在wcf Service1.svc.cs中编写的

    using System;
    using System.Configuration;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.ServiceModel.Activation;
    using System.Text;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web.Script.Serialization;

     [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
   public class enggcollegelist : ICRUD
    {

       public List<string> autobranches(string brname)
       { List<string> lstbranches = new List<string>();
        connection = new SqlConnection(ConnectionString);
        command = new SqlCommand("select branchname from tblenggbranchnames "+"where branchname LIKE '%'+@branches+'%' ",connection);
        connection.Open();
        command.Parameters.AddWithValue("@branches",brname);
        resultReader = command.ExecuteReader();
        while (resultReader.Read())
        {
            string items  =AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(resultReader["branchname"].ToString());

            lstbranches.Add(resultReader["branchname"].ToString());
        }
        connection.Close();
        return lstbranches;

    }
在上面的代码中,AjaxControlToolkit不接受。 我已经下载了ajax工具包,并在工具包中安装和添加了引用。
但也存在同样的问题。

找到了解决方案,只是重新添加了ajax工具包的引用,字符串项=AjaxControlToolkit.AutoCompleteXtender.CreateAutoCompleteItemresultReader[branchname].ToString;获取上述语句的另一个错误“方法“CreateAutompleteItem”没有重载takes 1 arguments”找到的解决方案,只是重新添加了ajax toolkit的引用,string items=AjaxControlToolkit.AutoCompleteXtender.CreateAutompleteItemResultReader[branchname].ToString;获取上述语句的另一个错误“方法“CreateAutompleteItem”没有重载接受1个参数”