开发者

AutoCompleteExtender ajax in asp.net ,

Hi I am using the AutoCompleteExtender ajax control. I am getting the list of strings in LIST collection. I want to populate only those strings, which user typing as prefix开发者_开发知识库 text. how to do this. I am following the example given in ajax toolkit.let say user typing "ca" then if list contain the list like, 'cat', 'dog', donkey', 'mouse','cart'....etc.

Then it should populate only 'cat' and cart'. How to achieve this?


In the example there's a description of the properties. Quote:

  • ServiceMethod - The web service method to be called. The signature of this method must match the following:

    [System.Web.Services.WebMethod]
    [System.Web.Script.Services.ScriptMethod]
    public string[] GetCompletionList(string prefixText, int count) { ... }
    

Note that you can replace "GetCompletionList" with a name of your choice, but the return type and parameter name and type must exactly match, including case.

  • ServicePath - The path to the web service that the extender will pull the word\sentence completions from. If this is not provided, the service method should be a page method.

So you need write a web service which will contain a method returning the list of suggestions based on the user input.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜