Question tells all. I got an AutoCompleteExtender that works as a clock on my pc running under VisualWebDeveloper's debug virtual machine but when I publish files on publication server it doesn't work... This is the code i use in codebehind:
<System.Web.Script.Services.ScriptMethod(), System.Web.Services.WebMethod(EnableSession:=True)> Public Shared Function SearchCustomers(ByVal prefixText As String, ByVal count As Integer) As List(Of String)
Dim conn As SqlConnection = New SqlConnection
conn.ConnectionString = ConfigurationManager.ConnectionStrings("AFTERSALES").ConnectionString
Dim cmd As SqlCommand = New SqlCommand
cmd.CommandText = "SELECT an_descr1, an_descr2 FROM anagrafica WHERE an_azienda = @azienda AND an_descr1 + ' ' + an_descr2 LIKE '%' + @SearchText + '%'"
cmd.Parameters.AddWithValue("@SearchText", prefixText)
cmd.Parameters.AddWithValue("@azienda", HttpContext.Current.Session("CODazienda").ToString)
cmd.Connection = conn
conn.Open()
Dim customers As List(Of String) = New List(Of String)
Dim sdr As SqlDataReader = cmd.ExecuteReader
While sdr.Read
customers.Add(Trim(sdr("an_descr1").ToString & " " & sdr("an_descr2").ToString))
End While
conn.Close()
conn = Nothing
Return customers
End Function
And here following are the controls i use in aspx search page (toolkitscriptmanager is in masterpage):
<asp:TextBox ID="TextBox1" runat="server" Width="300px" AutoPostBack="True"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="TextBox1" ServiceMethod="SearchCustomers"
MinimumPrefixLength="2" CompletionInterval="100" EnableCaching="false" CompletionSetCount="10" FirstRowSelected = "false"></ajaxToolkit:AutoCompleteExtender>