Jquery autocomplete in ASP.NET web forms?

Has anyone used jQuery to populate an autocomplete list in a text field using ASP.NET web forms? If so, can anyone recommend a good method? From my reading so far, it seems that most people use delimited lists rather than JSON to return elements. I am open to any ideas that will make me work and work pretty quickly.

0
source share
3 answers

There are many examples on the Internet. I used this before, and if you recall, you need to create aspx, which will return the relevant terms as a <BR/>split list:

http://www.dyve.net/jquery/?autocomplete

The documentation shows php in the example, but there is no difference in how the plugin itself works, and as a result I should not have done anything special.

From the documentation:

> $("#input_box").autocomplete("my_autocomplete_backend.php");

In the above example, Autocomplete expects an input element with the identifier "input_box" to exist. When the user starts typing in the input field, autocomplete will request my_autocomplete_backend.php with a GET parameter named q, which contains the current value of the input field. Let's say the user typed "foo" (without the quotes). Will autocomplete then request my_autocomplete_backend.php? q = Foo.

The backend should output values ​​for autocomplete, each of which is one line. The output cannot contain the pipe symbol "|", since this is considered a delimiter (more on this later).

: Foo foo

+1

I wrote Asp.Net WebControl and some ASP.NET MVC extension methods, completing the jQuery UI autocomplete widget.

I also wrote documentation on how to implement a work resource that provides a JSon result.

You can find it at:

http://autocompletedotnet.codeplex.com/

Hope this helps

+1
source

Source: https://habr.com/ru/post/1738893/


All Articles