Using Atlas:AutoCompleteExtender to simplfy browsing large lists

After people started to use our application reBlogger extensively and filled it with hundred of feeds, it become quite difficult to find a particular feed if someone requested it (for example, one blogger emailed us asking to remove his feed from reBlogger). The obvious solution for this problem whas to provide users with auto complete textbox, that will let them easily find a particular feed. Here is the screenshot of this reBlogger feature :

To achieve this, you need a classic Asp.NET text box, whose functionality you will later extend with Atlas:AutoCompleteExtender. So first the textbox :

OPEN CODE IN NEW WINDOW

There are few attributes here that you need to pay attention to. First of all it is TargetControlID, where you need to set the ID of the TextBox control that you want to extend (in our case, that is txtBlogTitle). Second attribute is the ServiceMethod, which is the name of the function that will return array of type string with suggested value (I’ll explain this function later in the post, so keep reading). Then we have ServicePath, which is nothing more than relative path for the .asmx file where GetBlogTitlesForAutoComplete function is located. Lastly, we have MinimumPrefixLength attribute. Obviously, this determines how many characters need to be entered by user so that the textbox starts suggesting results. For very large lists you may want to set this even higher (3 or 4), to increase performance, but bear in mind that it’ll be less useful at the same time.Now, that’s all we need to do in the .aspx page. Now, let’s turn to the manage_blogs.asmx file that actually returns the values to the AutoComplete textbox. I’ll write the whole function here first and then explain it.

OPEN CODE IN NEW WINDOW

The code is commented so you should have no problems understanding it. This is of course, just one way of doing it. The main thing is that you return a string array back. Also, it is important to note that you need to have the function with the signature as shown. 


This blog is being delivered to you by
reBlogger.com
“Do you know what your employees are blogging about?”


2 Responses to “Using Atlas:AutoCompleteExtender to simplfy browsing large lists”

  1. Dave Says:

    Your code links are broken. A shame.. I was looking forward to seeing your code.

  2. Kalpa Pharmaceuticals Says:

    This is a great post and thank you for sharing this nice experience, and hope you can give another posts as soon as possible.


Leave a comment