我的 aspx 页面的一部分
<asp:TextBox runat="server" id= "TextBox1" ></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender
runat="server" TargetControlID="TextBox1"
MinimumPrefixLength="0" ServiceMethod="getAutoComplete()"
ServicePath="nationality.aspx.cs"
>
</ajaxToolkit:AutoCompleteExtender>
我的 aspx.cs 代码:
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] getAutoComlete(string prefixText, int count, string contextKey)
{
string[] a = { "11", "22", "33" };
return a;
}
我正在尝试自动完成。我究竟做错了什么?