Saturday, February 21, 2009

AJAX -- AutoCompleteExtender

Now a days, when you search something on web, Once you type some thing in to search Textbox, The box come up with suggestion starting with that letter.

Here is the pretty good example:


When I typed the "abc" google started to give me suggestions. Its Looks good :-)

The same thing you can achieve in you web application using "AutoCompleteExtender" control.

Let me show you some example:
I wanted to display three more letter as a postfix whatever i am typing...

eg.. prashaXBZ // here laxt there XBZ is my suggestion
For that I will create one web method & it will give me random character.

//web method code




-----------------------------------------------------------------------------
Here is the my .aspx page code



-------------
HERE
MinimumPrefixLength="3" --> it will give you suggestion after three character.
CompletionSetCount="10" --> Number of suggestion you want to see
ServicePath="AutoComplete.asmx" --> My Service virtual path
ServiceMethod="GetCompletionList" --> My service method.
There we go...

No comments: