locked
help with ajax auto extender RRS feed

  • Question

  • User1757447809 posted

    hi i have a problem with the ajax autoextender it is not showing up the suggestion from the database here is the code

    Imports

    System

    Imports

    System.Collections

    Imports

    System.Linq

    Imports

    System.Web

    Imports

    System.Web.Services

    Imports

    System.Web.Services.Protocols

    Imports

    System.Xml.Linq

    Imports

    System.Collections.Generic

    Imports

    System.Data

    Imports

    System.Data.SqlClient

    ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.

    ' <System.Web.Script.Services.ScriptService()> _

    <WebService(Namespace:=

    "http://tempuri.org/")> _

    <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

    <

    Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _

    Public

    Class CustSearch

    Inherits System.Web.Services.WebService

    <System.Web.Script.Services.ScriptMethod(), _

    System.Web.Services.WebMethod()> _

    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(

    "Constry).ConnectionString

    Dim cmd As SqlCommand = New SqlCommand

    cmd.CommandText =

    "select EngrName from Engineer where" & _

    " EngrName like @SearchText + '%'"

    cmd.Parameters.AddWithValue(

    "@SearchText", prefixText)

    cmd.Connection = conn

    conn.Open()

    Dim Engineer As List(Of String) = New List(Of String)

    Dim sdr As SqlDataReader = cmd.ExecuteReader

    While sdr.Read

    Engineer.Add(sdr(

    "EngrName").ToString)

    End While

    conn.Close()

    Return Engineer

    End Function

    End

    Class

    <

    asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods =

    "true">

    </asp:ScriptManager>

    <asp:TextBox ID="txtContactsSearch" runat="server"></asp:TextBox>

    <cc1:AutoCompleteExtender ServiceMethod="CustSearch.asmx" MinimumPrefixLength="2"

    CompletionInterval="100" EnableCaching="false" CompletionSetCount="10" TargetControlID="txtContactsSearch"

    ID="AutoCompleteExtender1" runat="server" FirstRowSelected = "false" >

    </cc1:AutoCompleteExtender>

    Any Help Will be Greatly Appreiciate

    Wednesday, November 6, 2013 1:55 AM

Answers