我有一个问题。
我正在为我的文本框使用 AutoCompleteExtender。显示所有自动完成单词。但我需要下一个行为:当文本框中存在“*”字符时,不得显示自动完成单词。
我该怎么做?
最佳答案
在您的 ServiceMethod 中,您可以检查字符串是否存在通配符,但不返回任何结果?
[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
}
关于asp.net - 当 '*' 字符存在时禁用 AutoCompleteExtender,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1192931/