Re: AJAX Auto Complete: Doesn't display list

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks for your reply Leon. I really appreciate it.

But I have tried giving direct path to my web service. But still it
doesn't work.

Now I have created new web service in my same project and assign path
to .asmx file.
When I run .asmx file it ask me for inputs and displays xml file with
strings of suburbs.
But in default.aspx file, it doesn't show me auto complete list.

I am again posting the code of AjaxAutoCompleteWS.vb file:

<WebMethod()> _
Public Function LookUpSuburb(ByVal prefixText As String, ByVal
count As Integer) As String()

count = 10
Dim sql = "select distinct name from SUBURB where name like '"
+ prefixText + "%' order by name"
Dim cn As New SqlConnection()
Dim dt As New DataSet
cn.ConnectionString =
ConfigurationManager.ConnectionStrings("Conn").ConnectionString
cn.Open()
Dim da As New SqlDataAdapter(sql, cn)
Try
da.Fill(dt, "suburb")

Finally

If Not da Is Nothing Then
da.Dispose()
End If

If Not cn Is Nothing Then

If cn.State = ConnectionState.Open Then

cn.Close()
End If
End If
cn = Nothing
End Try


Dim items(dt.Tables("suburb").Rows.Count) As String

Dim i = 0
For i = 0 To dt.Tables("suburb").Rows.Count - 1

items(i) =
dt.Tables("suburb").Rows(i).Item("name").ToString()
Next
Return items


End Function


And my deffault.aspx file contains:

<asp:TextBox ID="TextBox1" runat="server" Width="322px"></
asp:TextBox><br />
<ajaxToolkit:AutoCompleteExtender
runat="server"
ID="autoComplete1"
TargetControlID="TextBox1"
ServiceMethod="LookUpSuburb"
ServicePath="AutoAjaxDp.asmx"
MinimumPrefixLength="1"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
CompletionListCssClass="autocomplete_completionListElement"
CompletionListItemCssClass="autocomplete_listItem"

CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
DelimiterCharacters=", :;">
</ajaxToolkit:AutoCompleteExtender>


I don't understand that why I am not getting it.

Thanks,
SV
.



Relevant Pages

  • Soap Request containing an array?
    ... that requires input as an array of a particular data structure and I ... public a1 as string ... dim myRequestStructure as new com.xxx.xxx.xxx.etc.RequestStructure ... But, that creates a problem when I get to the actual web service call, ...
    (microsoft.public.dotnet.framework.webservices)
  • Can someone help me sort this one out and quick?
    ... I am trying to extend the functionality by having the web service ... Function GetTransactionStatus(ByVal OrderNumber As String, ... Dim whrstat As System.Net.HttpWebRequest ... Dim responsestreamstat As System.Net.HttpWebResponse ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: memory leak?
    ... I have duplicated it into a simple web service. ... Dim connSQL As New OleDb.OleDbConnection ... Dim strSQL As String, strData As String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Soap Request containing an array?
    ... dim MyLocalB as new MyNewClass.MyBStructure ... It looks like the only problem you have is creating an array of structure ... I'm fried on this problem...It's vb.net, dealing with a web service ... public a1 as string ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Can someone help me sort this one out and quick?
    ... I am trying to extend the functionality by having the web service ... Function GetTransactionStatus(ByVal OrderNumber As String, ... Dim whrstat As System.Net.HttpWebRequest ... Dim responsestreamstat As System.Net.HttpWebResponse ...
    (microsoft.public.dotnet.framework.aspnet)