I am trying to play with Ajax Autocomplete Tool Box. I am using vb.net (Dont Net Nuke)
I am following the below tutorial
http://www.asp.net/ajaxlibrary/act_autocomplete_simple.ashx
What I did was I created a TextBox , Added Autocompleteextender
Manually Added Servicemethod
<ajax:autocompleteextender ID="AutoLastName" TargetControlID="txt_LastName" runat="server" UseContextKey="True" ServiceMethod="GetCompletionList"></ajax:autocompleteextender>
In the .vb file I added
<System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()>
Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String()
' Create array of movies
Dim movies() As String = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"}
' Return matching movies
Return (
From m In movies
Where m.StartsWith(prefixText,StringComparison.CurrentCultureIgnoreCase)
Select m).Take(count).ToArray()
End Function
This doesnt work for me. Am I doing something wrong?? Please correct me.