AutoCompleteExtender not suggesting search terms

Posted by Phil on Stack Overflow See other posts from Stack Overflow or by Phil
Published on 2010-05-26T10:48:15Z Indexed on 2010/05/26 10:51 UTC
Read the original article Hit count: 397

My codebehind method:

  <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
End Class

Then in my aspx page I have:

 <form id="form1" runat="server">
    <div>

        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>


    <br />
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" 
        DelimiterCharacters="" Enabled="True" ServiceMethod="GetCompletionList" 
        ServicePath="" TargetControlID="TextBox1" UseContextKey="True" MinimumPrefixLength="2">
    </asp:AutoCompleteExtender>
    </div>
    </form>

When I run the page there are no errors, but there also are no auto complete suggestions. Please help!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net