views:

84

answers:

1

Hi!

I have a problem.

I am using AutoCompleteExtender for my textbox. All autocomplete words shows. But i need next behavior: when there is in textbox '*' character, autocomplete words must not be shown.

How can i do this?

+3  A: 

In your ServiceMethod you could check the string for the presence of the wildcard, and not return any results?

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[] GetCompletionList(string prefixText, int count) {
  string[] results = null;
  if (string.IndexOf("*") == -1) {
    // Retrieve your autocomplete options here.
    // Create a new string[] and add the options.
  }
  return results
}
Zhaph - Ben Duguid