Asp.net 当前上下文中不存在名称“AjaxControlToolkit”
此代码是在wcf Service1.svc.cs中编写的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;
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个参数”