The Auto Complete Code is not working on my page and it is showing error on visual studio when i run it
Here is the code
Error 30 The type 'System.Web.UI.ExtenderControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. C:\Users\migold\Documents\Visual Studio 2013\WebSites\DebugSite\Master\Landing.master 324
HTML Code
<div class=" text-right col-lg-3" style=""><asp:TextBox ID="txtSearch" runat="server" Placeholder="Search....." CssClass="form-control" Height="34px" AutoCompleteType="DisplayName" autofocus=""></asp:TextBox><asp:AutoCompleteExtender runat="server" ServicePath="~/WebService.asmx" ID="AutoCompleteExtender1" ServiceMethod="GetSearch" TargetControlID="txtSearch" MinimumPrefixLength="1" ></asp:AutoCompleteExtender></div>
Code On Web Services.cs
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string[] GetSearch(string prefixText)
{
string sql = "Select * from User Where Name like @prefixText";
SqlDataAdapter da = new SqlDataAdapter(sql, "Data Source=STEVE\\KONN;Initial Catalog=con;Integrated Security=True");
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 100).Value = prefixText + "%";
DataTable dt = new DataTable();
da.Fill(dt);
string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
items.SetValue(dr["Name"].ToString(), i);
i++;
}
return items;
}
}