Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 不';AutoCompleteXtender是否适用于asp?_C#_Asp.net_Asp.net Ajax - Fatal编程技术网

C# 不';AutoCompleteXtender是否适用于asp?

C# 不';AutoCompleteXtender是否适用于asp?,c#,asp.net,asp.net-ajax,C#,Asp.net,Asp.net Ajax,我想将AutoCompleteExtender与此页面一起放入我的项目中: <asp:TextBox ID="txtMovie" runat="server"></asp:TextBox> <asp:TextBox ID="txtautofromDB" runat="server" autocomplete="off"></asp:TextBox> <asp:AutoCompleteExtender

我想将AutoCompleteExtender与此页面一起放入我的项目中:

     <asp:TextBox ID="txtMovie" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtautofromDB" runat="server" autocomplete="off"></asp:TextBox>
        <asp:AutoCompleteExtender ServiceMethod="GetCompletionList2" 
MinimumPrefixLength="2"
CompletionInterval="100" EnableCaching="true" CompletionSetCount="10" 
TargetControlID="txtMovie"
ID="AutoCompleteExtender1" runat="server" FirstRowSelected = "false" />

服务器代码为:

[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static string[] GetCompletionList2(string prefixText, int count)
{
    dt = Telephone.Search(prefixText);
    List<string> CountryNames = new List<string>();

    foreach(DataRow dr in dt.Rows)
    {
        CountryNames.Add(dr[0].ToString());

    }
    return CountryNames.ToArray();
}
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
公共静态字符串[]GetCompletionList2(字符串前缀,整数计数)
{
dt=电话搜索(前缀文本);
List CountryNames=新列表();
foreach(数据行dr在dt.行中)
{
CountryNames.Add(dr[0].ToString());
}
返回CountryNames.ToArray();
}

但是它不起作用。

但是它不起作用。帮帮我。
;你得帮我们,帮你。我们不知道你说的
是什么意思,但是它不起作用。
返回的数组不是空的,但是txtMovie没有显示任何东西。