0

I have a website that uses the AjaxControlToolkit. I'm making some parallel iPhone-friendly pages for the site, and since Ajax isn't very good-looking in a mobile browser, I'm trying to phase it out. One such Ajax tool is the CalendarExtender, which I replaced with the iPhone's Date Picker using this method.

The second tool I need to replace is the AutoCompleteExtender. It functions as a simple dropdown menu when the user types text into a text box. The purpose is for searching functionality; I have a large list of contacts, and when the user starts to type in a name or company name the extender appears with a list of suggestions based on what the user typed in so far.

Here's what it looks like in Ajax:

<asp:TextBox ID="NameTextBox" runat="server" AutoComplete="off" AutoPostBack="True"
                                        OnTextChanged="NameTextBox_TextChanged" Width="95%" Font-Size="Medium"></asp:TextBox>
                                    <cc1:AutoCompleteExtender ID="NameTextBox_AutoCompleteExtender" runat="server" CompletionInterval="250"
                                        CompletionListCssClass="autocomplete_completionListElement" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                        CompletionListItemCssClass="autocomplete_listItem" DelimiterCharacters="" Enabled="True"
                                        MinimumPrefixLength="2" ServiceMethod="GetCompletionList" ServicePath="" TargetControlID="NameTextBox"
                                        UseContextKey="True">
                                    </cc1:AutoCompleteExtender>

What is a good way to replace this with either a common piece of iPhone UI (such as the UIPickerView), or a more general mobile-friendly piece of HTML?

Community
  • 1
  • 1
Andrew
  • 466
  • 2
  • 7
  • 22

1 Answers1

1

I would use a standard HTML element to maintain user experience. For the autocomplete part I would use some javascript or an jQuery plugin. You could also choose to use Autocomplete from jQuery UI: http://jqueryui.com/demos/autocomplete/.

tschoffelen
  • 518
  • 7
  • 21
  • This looks like it should work quite nicely. I'll need to see how well it handles larger elements in the autocomplete list (each element in my list is the full name and company name of a contact). But viewing that demo from my app looked smooth and clear, unlike the Ajax tool which broke rather severely in this mobile environment. – Andrew Mar 26 '12 at 17:56