views:

2008

answers:

1

Hi,

I want to test the dropdownlist autocomplete ajax extension to work. I am testing this in Visual Web Developer Express 2008.

1) I dropped a textbox on the default.aspx form 2) Dropped a scriptcontrol from the Ajax Toolbox 3) Extended the Autocomplete extension to the textbox

BTW, at this point, if I display the properties for the AutoCompleteExtender, the ServicePath property is black. If I click there, VWDE2008 crashes (!)

I want a simple way to test the Autocomplete function, preferrably without setting up a webservice (or if using a webservice, with a simple explanation). I would like to display the options from a simple C# List, for example, of cities, like:

Copenhaguen, Denmark
Miami, Florida, USA
Paris, France

declared directly in the code (not read from a database). At this point, most people are suggesting using jquery instead. I have not been able to find a SIMPLE (non-video) tutorial to set this up!

Can anyone help?

Thanks!

A: 

You can use AutoComplete with a PageMethod instead of a web service. The method decorations are similar, but the code remains "in" the page and can access session variables and whatnot.

I found what looks like an OK example of setting that up here:

http://allwrong.wordpress.com/2007/03/13/ms-ajax-autocomplete-extender-using-a-page-method/

womp