Can I use the AJAX Autocomplete extender *without* a webservice?

David picture David · Apr 23, 2009 · Viewed 7.4k times · Source

Using ASP.NET 3.5 with VB codebehind.

I don't want to use a webservice to populate an autocomplete extender on a textbox. In this case, it's where the user is entering email addresses and I don't want to make a trip to the database every single time. I'd much rather keep a collection in session state and 'bind' the autocomplete to that.

Is it possible to set ServicePath and/or ServiceMethod to something in the codebehind as opposed to a webservice?

Answer

naasking picture naasking · Oct 20, 2010

Yes, ServiceMethod can name a page method. See the documentation for AutoCompleteExtender. ServicePath as optional, and if ommitted, ServiceMethod is taken to reference a static method of the current ASP.NET page (which must be decorated with 2 specific attributes).