Re: AJAX Auto Complete: Doesn't display list
- From: SV <swetavyas@xxxxxxxxx>
- Date: Sun, 18 May 2008 21:49:08 -0700 (PDT)
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
.
- Follow-Ups:
- Re: AJAX Auto Complete: Doesn't display list
- From: Leon Mayne
- Re: AJAX Auto Complete: Doesn't display list
- References:
- Text recognition in ASP.Net
- From: SV
- Re: Text recognition in ASP.Net
- From: Leon Mayne
- Re: Text recognition in ASP.Net
- From: SV
- AJAX Auto Complete: Doesn't display list
- From: SV
- Re: AJAX Auto Complete: Doesn't display list
- From: Leon Mayne
- Text recognition in ASP.Net
- Prev by Date: Re: connection between database & website located at different places
- Next by Date: Overly country sales figures on world map
- Previous by thread: Re: AJAX Auto Complete: Doesn't display list
- Next by thread: Re: AJAX Auto Complete: Doesn't display list
- Index(es):
Relevant Pages
|