Last post Nov 13, 2006 04:22 PM by dmehers
Nov 13, 2006 04:22 PM|dmehers|LINK
I created this article based on a presentation I gave as a finalist in the Barcelona TechEd "Speaker Idol" competition.
Any and all feedback appreciated, the article is at http://damianblog.com/
I'm attaching the first part here.
If you want to run through the steps I describe here, you’ll need to download and install the
ASP.NET AJAX kit, and the
AJAX Control Toolkit. There is a download link at the end of the article, from which you can download the complete code.
Before diving into the details of the AJAX Control Toolkit, I’d like to first share with you a situation will probably strike a chord.
A couple of years ago I had a user of our web site that complained that the standard behavior of the ASP.NET ListBox control, which by default renders as an HTML SELECT, was broken.
As far as she was concerned when she typed a sequence of characters there should be an incremental search within the contents of the ListBox, rather than the default behavior which simply jumps to the first element that starts with each character. If you
type “mi” in a ListBox then you’ll end up at “IBM” rather than “Microsoft”:
I added a couple of event handlers to detect when the user gives the SELECT focus, and to detect when they typed characters within the SELECT. When the user gives the SELECT the focus I create a DIV with a prompt that tells them that they can search, and
then when they type characters I replace the prompt message with the characters that were typed, and I select the first item that starts with the characters that were typed.
There are a few issues with this implementation:
Microsoft’s ASP.NET AJAX and the Atlas Control Toolkit address all of these issues.
Once you’ve installed the AJAX Control Toolkit, you’ll need to double-click on the
AjaxControlExtender.vsi file in the AjaxControlExtender subdirectory under the kit. Doing this will install a Visual Studio Template which you can use to create AJAX Control Extenders.
If you then fire up Visual Studio 2005, and hit File|New|Project you will be presented with the option of creating a new ASP.NET AJAX Control Project. Select this option and give your project a suitable name – I’ve used
ListSearch. Once you hit OK you should find yourself with a project with three files:
Contnues here: http://damianblog.com/