Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
iam new to vs 2010. i have an webservice that is working fine when invoked. but when it is used in the autocomplete ajax control in asp.net. it is not responding. i know there needs to be changes made in the web.config file which i dont know.

need to know what iam missing. these are the steps that i've followed:

1) declared the webmethod in the following manner which when invoked gives me the desired result
[System.Web.Services.WebMethod(EnableSession = true)]
[System.Web.Script.Services.ScriptMethod]
public string[] functionname(string prefixText)
{
//code
return string;
}


2) used these properties in the autocomplete tool kit

ServicePath="ServiceName.asmx" ServiceMethod="functionname" MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="1" EnableCaching="true"

3) included the script manager code

4) included the following in web.config under System.web tag

XML
<httphandlers>
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory" validate="false" />
    </httphandlers>




when run the autocomplete does not work. don't know what iam missing please help.
Posted
Updated 11-May-13 7:42am
v3

Your service method signature does not match the one that the control expects. This is what your method signature should look like.

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


more details in this link:
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx[^]
 
Share this answer
 
Thank you. it works now. had actually copied the webservice; used in vs 2005; that was working. Thanks again.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900