Brian Grimal

Scarcely updated personal blog

Microsoft AJAX AutoCompleteExtender

So, I’m doing a little ASP.NET coding, using Visual Studio 2008, all the fancy junk including their snazzy stuff delivered in the Ajax Control Toolkit.  I want to use one of the easiest controls in the bunch, an AutoCompleteExtender.  Following the examples, I drop everything in, write all the bits, and — voila !! nothing happens.  WTF?  I follow ‘em again, dot the i’s and cross the t’s, or so I’m thinking, but still nothing.  It took a bit of scouring Google, but I finally stumbled upon my answer and promptly slapped myself in the forehead.

Since these are web service based, your function declaration *MUST* name the parameters *exactly* as the shown in the examples.  Let me make it really clear.  This works:

<WebMethod()> _
Public Function AutoComplete(ByVal prefixText As String, ByVal count As Integer) As String()

This does not work:

<WebMethod()> _
Public Function AutoComplete(ByVal terms As String, ByVal numResults As Integer) As String()

With web services, the function is bound to each parameter NAME, versus the parameter OFFSET like you would come to assume spending your time in a compiled environment.

Just one of those things to keep in mind when working with web services!

 

No Responses to “Microsoft AJAX AutoCompleteExtender”

Comments are closed.

Leave a Reply