Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Dynamic autocomplete extender not firing

$
0
0

Hello,

I have an aspx page that dynamically creates some textboxes. I am trying to attach a autocomplete extender, but the method doesn't get called.

Code :

Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If (Not Page.IsPostBack) Then
            For i As Integer = 0 To 1

                Dim textBoxID As String = "AutoCompleteTextBox" & i
                Dim textbox As New TextBox
                textbox.ID = textBoxID
                textbox.Width = New Unit(250)
                textbox.Attributes.Add("autocomplete", "off")


                Dim autoCompleteExtender As New AjaxControlToolkit.AutoCompleteExtender()
                autoCompleteExtender.TargetControlID = textBoxID
                autoCompleteExtender.ServiceMethod = "GetCompletionList"
                autoCompleteExtender.ServicePath = "/Default.aspx"
                autoCompleteExtender.CompletionInterval = 100
                autoCompleteExtender.CompletionSetCount = 10
                autoCompleteExtender.EnableCaching = True

                Me.Panel1.Controls.Add(textbox)
                Me.Panel1.Controls.Add(autoCompleteExtender)

            Next i

        End If
    End Sub
    <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()
        Dim s As String() = Split("a|b|c", "|")
        Return s
    End Function

Am I missing something here?

Thanks in advance


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>