vb.net - asp.net Auto complete textbox from database -


I tried to create a text box which suggests with the database column. However, it is showing the error when I run that page.

Error - The file or assembly could not load 'AjaxControlToolkit' or one of its dependencies can not get a system specified file

ASP code

  & Lt; ASP:. ToolkitScriptManager id = "ScriptManager1" runat = "server" & gt; & Lt; / ASP: ToolkitScriptManager & gt; & Lt; ASP: AutoCompleteExtender id = "autoComplete1" runat = "server" EnableCaching = "true" BehaviorID = "AutoCompleteEx" MinimumPrefixLength = "2" TargetControlID = "myTextBox" ServicePath = "AutoComplete.asmx" ServiceMethod = "GetCompletionList" CompletionInterval = "1000" Completion list = "20" Closing listCSSClas = "AutoComplete Connection Lilite" Closing ListItamsCSSClass = "AutoComplete List List" Closing List Highlighted ITMS Class = "Autoplay_Holight List Item" Delimiter Converters = ";" ShowOnlyWorldWorldIncompublicNistItim = "True" & gt; & Lt; / ASP: AutoCompleteExtender & gt; & Lt; TD & gt; & Lt; ASP: Text box id = "TextBox2" runat = "server" CssClass = "text_box" auto-complete = "off" & gt; & Lt; / ASP: text box & gt; & Lt; Br / & gt; & Lt; Asp: RequiredFieldValidator ID = "RequiredFieldValidator1" runat = "server" ControlToValidate = "TextBox2" Error = "Please enter the client / company name" style = "color: # f00; font-size: 11px" & gt; & Lt; / ASP: RequiredFieldValidator & gt; & Lt; / TD & gt;  

vb code

  & lt; System. Web.Script.Services.ScriptService () & gt; _ & Lt; WebService (namespace: = "http://tempuri.org/") & gt; _ & Lt; WebServiceBinding (conformsTo: = WSIProfiles.BasicProfile1_1) & gt; _ Public class autocompoli inheritance system.webservice.webservice DM cns new SQLextra. New Datatyll as new Dataset DIT DT as SQL Connection () DISL & lt; WebMethod () & gt; _ Public Function GetCompletionList (ByVal prefixText As String, _ ByVal count integer) as (as a string) 'ADO.Net dim strCn String = _ as "Data Source = Sonam-PC \ SQLSERVER2008R2; preliminary list = from Brandstik2; integrated Security = true "cn.ConnectionString = strCn dim cmd as new SqlClient.SqlCommand cmd.Connection = cn cmd.CommandType = CommandType.Text database (CompanyName) and column string" text box (prefixText) Compare String '' String So Database Is Equal to Tex String from the stbox (prefix text) 'and then add item item to return ----- I define the parameter instead of specifying the value' directly to prevent SQL injection -------- ' CMD. Command Text = "Choose from * BrandstikTesti where client_name @myParameter like" cmd.Parameters.AddWithValue ("@ myParameter", "%" + Prefix Text + "%") CN. Open () CMD Dim result Aksakyunet (NIC) Ew SqlDataAdapter (cmd) da.Fill (ds) exchange as Hold end CnkClose (in) finally try dt = ds.Tables (0) 'Return list of strings (TxtItems) TxtItems as the new list (string of) of the string as the string for the string in the form of the string 'dt.Rows' in the 'string' database (dbvlues) dbValues ​​= queue ("client_name"). ToString () dbValues ​​= dbValues.ToLower () txtItems.Add (dbValues) Next Return txtItems Koaarara () End Function Enz Class  

Add the top of your ASPX page

  & lt;% @ Register Assembly =" Ajax ControlTulk Kit "Namespace =" Ajax ControlTulk Kit "tag =  

or you're losing DLL


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -