jayh99
asked on
Autocomplete Extender Problem
I am having a problem getting an autocomplete extender to work in asp.net. Below is the code that I am attempting as a test to get it working. Currently, nothing happens when text is entered into the text box.:
=================
Autocomplete.asmx:
=================
<%@ WebService Language="VB" Class="Names" %>
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protoc ols
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Service s.ScriptSe rvice()> _
<WebService(Namespace := "http://tempuri.org/")> _
<WebServiceBinding(Conform sTo:=WsiPr ofiles.Bas icProfile1 _1)> _
Public Class Names
Inherits System.Web.Services.WebSer vice
<WebMethod()> _
Public Function Names(ByVal prefixText As String, ByVal count As Integer) As String()
Dim list As New List(Of String)
For i = 1 To 5
list.Add(prefixText & " - " & i)
Next
Return list.ToArray
End Function
End Class
=================
Search.aspx:
=================
...
Test: <asp:TextBox ID="TEST" runat="server" />
<cc1:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="TEST" ServiceMethod="Names" ServicePath="Autocomplete. asmx" MinimumPrefixLength="2" CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20" DelimiterCharacters=";, :" ShowOnlyCurrentWordInCompl etionListI tem="true" ></cc1:Aut oCompleteE xtender>
...
Thanks in advance for any assistance you can offer!
=================
Autocomplete.asmx:
=================
<%@ WebService Language="VB" Class="Names" %>
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protoc
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Service
<WebService(Namespace := "http://tempuri.org/")> _
<WebServiceBinding(Conform
Public Class Names
Inherits System.Web.Services.WebSer
<WebMethod()> _
Public Function Names(ByVal prefixText As String, ByVal count As Integer) As String()
Dim list As New List(Of String)
For i = 1 To 5
list.Add(prefixText & " - " & i)
Next
Return list.ToArray
End Function
End Class
=================
Search.aspx:
=================
...
Test: <asp:TextBox ID="TEST" runat="server" />
<cc1:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="TEST" ServiceMethod="Names" ServicePath="Autocomplete.
...
Thanks in advance for any assistance you can offer!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
LOL I was just getting ready to post on this. You didn't need to add it, you just needed to uncomment it about 4 lines up from where you added it.