Google Search

Google
 

Sunday, July 13, 2008

Video: How Do I: Use the ASP.NET AJAX AutoComplete Control

Presenter:Joe Stagner

The AutoComplete extender control from the ASP.NET AJAX Control Toolkit provides real-time suggestions to the user as he or she types in a text box on the Web page, where the list of suggestions is obtained by an asynchronous call to a Web service on the server.

The following text is a software generated transcript of the video. Click on a minute link to jump to a location within the video


Minute 0

In this video don t demonstrate the use of the auto completes the control that ships as part of Microsoft execs control to look at the auto complete extender is a great way for you to provide real time suggestions your user as a type into a text box in your ears got a web form so it started as usual fire official or developer created Ajax enabled website and I go over into our default is its page is for surrender here is grab it if given a text box control and just for easy viewing all summer justify my control and here s the text boxes could be the target of our auto complete extender home on the ahead and got onto the Ajax controlled toolkit tool to have in my Visual Studio toolbox the auto complete extender control drop out of my page that messages the news is already an instance of the Ajax controlled toolkit deal

Minute 1

Out in my bin directory so miscellaneous and eat a service to call as the user types of attacks so will do that by creating Web service here in our garden or a student project so say ad litem who make his web service sleepless from a separate file in some observers will collect auto complete enough to see the demo understood by use any and uses static method and a couple things we do here as the first is order for this nor for the Web methods in this class to be accessible from JavaScript code me to come at the system Web script services score service attribute this tells the is the runtime do we want the methods are

Minute 2

Found in this glass or defining here to be callable via a good JavaScript hotels runtime that it needs to answer calls into JS by generating the jobs were called proxy also because were using a collection here in me to import system collections generic object so systems go to quickly hear so or do you only hear its base than just taking a risk is called on taking the input and I m a pending so I m appending three randomly generated characters now this is just for simplicity sake in your application on their lots of opportunities for how you can drive the status of for example you can him use a use a SQL expression with the likes with a like parameter to the search

Minute 3

Brix fields your database you could keep a cache of previously entered data really the of the options are relentless in our case were to screw us of all generate Willis matter what the yacht with a Web service does terms of how you see the controls are so backer picture that we can go in and we can now start to configure our auto completes under the first thing we specify is the target control ID in our case the target control ID is the one text boxes on the page so would just use that name experience do is need to specify more orderly calling by whisper passes for method bouts or service path and method but order to do that need to add a service rep

Minute 4

So that the script manager knows where to go and get the proxies to the job out to the gels for probable service methods are recalling so a minimum of creative services collection inside the services collection of the specify service reference and I m never in a indicate that the path is going to be a auto complete us and ask no doubt we does not specify the filename of the Uzbek file because this is a to locals of a local Web service is in her project if it were in another project or solution or elsewhere are her words are read need to specify a resolvable path so that I ve done that I can specify the the service and the method names source

Minute 5

Path and service method is going to be in the name of the method that we use here so a completion list is also couple things you want to add or see a minimum prefix length of this is the number characters that you can be typed before we start calling the service method to make suggestions the other thing we wanted to tell it is completion set counsel how many how many suggestions to want to be returned to set that equal to 12

Minute 6

And untenable collection of of properties of for example say was that enable caching equal to true so we can use caching to improve the performance will do to want to what have you fetched enough to us for the purposes of the Devil sold for a fired up the city of the the text box will appear as I start to type into the text box when I get the three characters noticed at the at the suggestion startled All because that s what we specified and that s if it s that easy to use the auto complete extender control ships as part of the ASP net Ajax control toolkit to add dynamic suggestions to user input

Minute 7

Thing text boxes and Microsoft Ajax and the Ajax control told to

Click here to go to original video page

No comments: