在ASP.Net中使用C#从SQL Server DB自动完成

时间:2022-02-25 18:15:46

I try AutoComplete dropdown using C# code. Can I do without using AJAX. Or must use AJAX. How could I do? Can I use like that?

我尝试使用C#代码自动完成下拉列表。我可以不使用AJAX吗?或者必须使用AJAX。我该怎么办?我能这样用吗?

public string[] GetCompletionList(string prefixText, int count, string contextKey) 
{ ... }

1 个解决方案

#1


0  

you must use Ajax because without it you will reload your page for every key stroke. You can use JQuery plugin called Autocomplete or make your Ajax call.

你必须使用Ajax,因为如果没有它,你将为每个关键笔划重新加载你的页面。您可以使用名为Autocomplete的JQuery插件或进行Ajax调用。

you can find autocomplete here http://docs.jquery.com/UI/Autocomplete

你可以在这里找到自动完成http://docs.jquery.com/UI/Autocomplete

#1


0  

you must use Ajax because without it you will reload your page for every key stroke. You can use JQuery plugin called Autocomplete or make your Ajax call.

你必须使用Ajax,因为如果没有它,你将为每个关键笔划重新加载你的页面。您可以使用名为Autocomplete的JQuery插件或进行Ajax调用。

you can find autocomplete here http://docs.jquery.com/UI/Autocomplete

你可以在这里找到自动完成http://docs.jquery.com/UI/Autocomplete