473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AutoComplete not filtering with Ajax

Hi, I have a text box which I have associated with an
AutoCompleteExtender.

e.g.

<cc1:AutoCompleteExtender
runat="server"
ID="autoComplete1"
TargetControlID="TextBox1"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="2"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
/>

I then have the following codebehind method which basically just
returns a string array containing countries

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
return AutocompleteHelperClasses.GetCountryList();
}

When I go to my page and enter three characters into the text box I
get the list of all the countries. No filtering is applied when I add
more characters to the text box however. E.g if I enter Belgium I
still see all the countries from Australia through to Zaire

Help appreciated
Thanks
Markus
Nov 26 '07 #1
4 2742
hello, your problem is the chars separator option... look at this.

MarkusJ_NZ wrote:
Hi, I have a text box which I have associated with an
AutoCompleteExtender.

e.g.

<cc1:AutoCompleteExtender
runat="server"
ID="autoComplete1"
TargetControlID="TextBox1"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="2"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
/>

I then have the following codebehind method which basically just
returns a string array containing countries

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
return AutocompleteHelperClasses.GetCountryList();
}

When I go to my page and enter three characters into the text box I
get the list of all the countries. No filtering is applied when I add
more characters to the text box however. E.g if I enter Belgium I
still see all the countries from Australia through to Zaire

Help appreciated
Thanks
Markus
Nov 26 '07 #2
On Nov 26, 10:39 pm, Steph <st...@pipoland.comwrote:
hello, your problem is the chars separator option... look at this.

MarkusJ_NZ wrote:
Hi, I have a text box which I have associated with an
AutoCompleteExtender.
e.g.
<cc1:AutoCompleteExtender
runat="server"
ID="autoComplete1"
TargetControlID="TextBox1"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="2"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
/>
I then have the following codebehind method which basically just
returns a string array containing countries
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
return AutocompleteHelperClasses.GetCountryList();
}
When I go to my page and enter three characters into the text box I
get the list of all the countries. No filtering is applied when I add
more characters to the text box however. E.g if I enter Belgium I
still see all the countries from Australia through to Zaire
Help appreciated
Thanks
Markus- Hide quoted text -

- Show quoted text -
Hi, thanks for that but what should I use?
Thanks
Mark
Nov 26 '07 #3
MarkusJ_NZ wrote:
On Nov 26, 10:39 pm, Steph <st...@pipoland.comwrote:
>hello, your problem is the chars separator option... look at this.

MarkusJ_NZ wrote:
>>Hi, I have a text box which I have associated with an
AutoCompleteExtender.
e.g.
<cc1:AutoCompleteExtender
runat="server"
ID="autoComplete1"
TargetControlID="TextBox1"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="2"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
/>
I then have the following codebehind method which basically just
returns a string array containing countries
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
return AutocompleteHelperClasses.GetCountryList();
}
When I go to my page and enter three characters into the text box I
get the list of all the countries. No filtering is applied when I add
more characters to the text box however. E.g if I enter Belgium I
still see all the countries from Australia through to Zaire
Help appreciated
Thanks
Markus- Hide quoted text -
- Show quoted text -

Hi, thanks for that but what should I use?
Thanks
Mark
hi mark, i first time, have you test manually your webservice ?
if all is ok, your control code is not perfect,
you must add :
DelimiterCharacters=";,:"
ServicePath="~/yourdirectoryaspxfile/autocompletion.asmx" (nb : your
webservice must in : App_Code (/AppCode/autocompletion.cs and
autocompletion.asmx contain :
(..)CodeBehind="~/App_Code/autocompletion.cs"(..) )

steph
Nov 27 '07 #4

"Steph" <st***@pipoland.comwrote in message
news:47**********************@news.orange.fr...
MarkusJ_NZ wrote:
>On Nov 26, 10:39 pm, Steph <st...@pipoland.comwrote:
>>hello, your problem is the chars separator option... look at this.

MarkusJ_NZ wrote:
Hi, I have a text box which I have associated with an
AutoCompleteExtender.
e.g.
<cc1:AutoCompleteExtender
runat="server"
ID="autoComplete1"
TargetControlID="TextBox1"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="2"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
/>
I then have the following codebehind method which basically just
returns a string array containing countries
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
return AutocompleteHelperClasses.GetCountryList();
}
When I go to my page and enter three characters into the text box I
get the list of all the countries. No filtering is applied when I add
more characters to the text box however. E.g if I enter Belgium I
still see all the countries from Australia through to Zaire
Help appreciated
Thanks
Markus- Hide quoted text -
- Show quoted text -

Hi, thanks for that but what should I use?
Thanks
Mark

hi mark, i first time, have you test manually your webservice ?
if all is ok, your control code is not perfect,
you must add :
DelimiterCharacters=";,:"
ServicePath="~/yourdirectoryaspxfile/autocompletion.asmx" (nb : your
webservice must in : App_Code (/AppCode/autocompletion.cs and
autocompletion.asmx contain :
(..)CodeBehind="~/App_Code/autocompletion.cs"(..) )

steph

Just a guess but since you are not passing the characters the user has input
to the AutocompleteHelperClasses.GetCountryList routine you are getting all
the countries. You should be passing prefixText into your subroutine to
allow the subroutine to filter.

LS

Nov 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: shalinmangar | last post by:
Hi, I want to build an Ajax based autocomplete feature. Being a server side guy, I have little knowledge regarding layers and DHTML stuff. Having already implemented the AJAX part of the app, I am...
1
by: Cheng Guangnan | last post by:
<a href="http://capxous.com/autoassist/">AutoAssist 0.6.5</a> What? Ajax autocomplete widget on web pages, the way to archive effective and comfortable. And it is pure JavaScript so will not...
5
by: jdzemke | last post by:
I am getting 'options' is null or not an object using when using a dynamic dataset with a dropdown list in an html form. I am filling-in a text field and filtering the values in the drop-down. ...
10
by: kym | last post by:
I am having problems using the ajax autocomplete. I actually think it may be an Oracle problem not autocomplete problem because I can get the autocomplete working without searching the database for...
2
by: Lloyd Sheen | last post by:
I am trying to get this to work. Basically copied the code from the toolkit but absolutely nothing happens. Any ideas?? The code was inserted into an existing page. <asp:TextBox...
1
by: Samnang | last post by:
Hi, I have been used Ajax AutoComplete/AutoSuggestion in my ASP.net project( http://www.codeproject.com/Ajax/AJAXAutoSuggest.asp), but now I found a problem when I used it in my repeater, I can't...
0
by: JM_newsgroups | last post by:
Hello, I see how DynamicPopulate allows one to use the AJAX loading icon with CSS. Does anybody know how to do this with the AutoComplete extender? I want to provide a little user feedback. I...
10
by: bonneylake | last post by:
Hey Everyone, Right now i have a script where when someone starts typing in the input field that it populates the drop down box next to it. Once both the input and drop down box have the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.