Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi experts,
i want to add ajax autocomplete extender in my project that has been created in vb.
but service method is not calling. Its not working properly please help me solve this issue.

my code is
ASP.NET
<asp:TextBox ID="txtSearch" runat="server" AutoCompleteType="FirstName" ></asp:TextBox>
<asp:AutoCompleteExtender ID="ACEtxtSearch" runat="server" MinimumPrefixLength="0"
ServiceMethod="GetCompletionList" Enabled="True" TargetControlID="txtSearch" 
EnableCaching="true" FirstRowSelected="true"
CompletionInterval="10" CompletionSetCount="10" CompletionListCssClass="completionList" CompletionListItemCssClass="listItem"
CompletionListHighlightedItemCssClass="itemHighlighted">
</asp:AutoCompleteExtender>

vbcode
VB
<WebMethod()> _
Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()

End Function

please help me solve this issue
thanks in advance
(Keerthi Kumar)
Posted
Updated 3-Jun-14 17:00pm
v2

1 solution

change your web method signature as below
VB
<system.web.script.services.scriptmethod(),>System.Web.Services.WebMethod()> _
Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As List(Of String)


End Function

And you better follow the stems in AJAX AutoCompleteExtender Example in ASP.Net[^]
 
Share this answer
 
v2
Comments
Keerthi Kumar(Andar) 3-Jun-14 23:17pm    
Hi DamithSL,
thanks a lot.. its working.
DamithSL 3-Jun-14 23:47pm    
You are welcome!

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



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