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...

ASP.NET Ajax ToolKit

Last week I got little time to explore new stuff in AJAX took kit.
Here is the step how to get AJAX toolkit controls in your web site.

1) Create Sample websit (in 3.5)
2) Get the "AjaxControlToolkit.dll" from the following links
http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?
ReleaseId=16488
3) Right click on "Toolbox" of your website and select "Add Tab" & give the tab name
"Ajax Controls Toolkit".
4) Right click and select "Choose Item..." and browse the above .dll
5) There we go... you will get all the Microsoft Ajax Extention controls under
the "Ajax Controls Toolkit" tab.