Posts

Showing posts with the label AutocompleteExtender

Donate

Using AJAX Control Toolkit AutoCompleteExtender In ASP.NET 4.5 Web Forms

Image
Hello all, I have posted in VBForums codebank on how to integrate Ajax Toolkit's AutoCompleteExtender control in your ASP.NET 4.5 Web Forms project. The thread is in VB.NET but if your using C# just replace the code behind as described in Step 4 with the snippet below. Code Behind private static AdventureWorks2012Entities _context; [ScriptMethod()] [WebMethod] public static List< string > GetCountries( string prefixText, int count) { _context = new AdventureWorks2012Entities(); var result = ( from country in _context.CountryRegions.AsEnumerable() where country.Name.ToLower().StartsWith(prefixText, StringComparison.OrdinalIgnoreCase) select country.Name).Take(count); return result.ToList(); } [ScriptMethod()] [WebMethod] public static object GetCountryInfo( string Country) { _context = new AdventureWorks2012Entities(); var result = ( from country in _context.CountryRegions.AsEnumerable() where country.Name.ToLower().Equals(C

Format Width Of AutocompleteExtender AjaxControlToolkit

By default, the width of the autocomplete list of autocomplete extender is inherited from the target control which is the textbox. However, you can customize the width and appearance of the ajax control: 1. Create an asp.net website 2. Add a webservice to your site 3. In your webservice, add a code to retrieve customer or any info. 4. In your asp.net website, add an aspx markup similar below:  Note that CompletionListElementID target control is the div called autocomplete declared below the textbox. <asp:ToolkitScriptManager ID= "ToolkitScriptManager1" runat= "server" > <Services> <asp:ServiceReference Path= "~/YourSampleService.asmx" /> </Services> </asp:ToolkitScriptManager> <div> <table> <tr> <td><asp:TextBox ID= "txtName" runat= "server" ></asp:TextBox></td> <td><div id= "AutoComplete" runat= "server&q

Donate