469,645 Members | 1,653 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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 2627
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by shalinmangar | last post: by
2 posts views Thread by Lloyd Sheen | last post: by
reply views Thread by JM_newsgroups | last post: by
10 posts views Thread by bonneylake | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.