473,288 Members | 2,725 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,288 software developers and data experts.

Trouble using AutoCompleteExtender

hi

VS2008

I have trouble getting the AutoCompleteExtender to work. I've seen the video
at
http://www.asp.net:80/learn/ajax-videos/video-122.aspx but don't understand
what I do wrong. I've even downloaded the source code next to the video and
cannot see what I do wrong here. When I run the .aspx webpage, I start
typing in the textbox but isn't called after I've typed in 3 chars. I know
that method isn't called as I've set a breakpoint in the start of the
GetCompletionList method.

In my datasource there is a name with the pattern "uuu", so if I start
typing "uuu" atleast that name shold be displayed...

*** markup in my .aspx webpage *****************
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/Services/AutoCompleteName.asmx" />
</Services>
</asp:ScriptManager>

Name: <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
TargetControlID="txtName"
ServicePath="~/Services/AutoCompleteName.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="3" CompletionSetCount="10" >
</ajaxToolkit:AutoCompleteExtender>

******* ****************

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX,
uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class AutoCompleteName : System.Web.Services.WebService {

public AutoCompleteName () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public string[] GetCompletionList(string prefixText, int count)
{
List<NamenameCollection = Name.GetNames(prefixText, count);
List<stringnames = null;
foreach (Name name in nameCollection)
{
names.Add(name.surename);
}
return names.ToArray();
}

}

could it be caused by this: ServicePath="~/Services/AutoCompleteName.asmx"
in the video source code it is ServicePath="AutoCompleteName.asmx", but I've
created a subfolder for my .asmx files just in case my project will have
more .asmx files. I thought it was a nice way of keeping the project tidy,
not having everything in the root folder.....

any suggestions?
Nov 21 '08 #1
2 4949


"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:ec**************@TK2MSFTNGP05.phx.gbl...
hi

VS2008

I have trouble getting the AutoCompleteExtender to work. I've seen the
video at
http://www.asp.net:80/learn/ajax-videos/video-122.aspx but don't
understand what I do wrong. I've even downloaded the source code next to
the video and cannot see what I do wrong here. When I run the .aspx
webpage, I start typing in the textbox but isn't called after I've typed
in 3 chars. I know that method isn't called as I've set a breakpoint in
the start of the GetCompletionList method.

In my datasource there is a name with the pattern "uuu", so if I start
typing "uuu" atleast that name shold be displayed...

*** markup in my .aspx webpage *****************
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/Services/AutoCompleteName.asmx" />
</Services>
</asp:ScriptManager>

Name: <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
TargetControlID="txtName"
ServicePath="~/Services/AutoCompleteName.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="3" CompletionSetCount="10" >
</ajaxToolkit:AutoCompleteExtender>

******* ****************

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX,
uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class AutoCompleteName : System.Web.Services.WebService {

public AutoCompleteName () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public string[] GetCompletionList(string prefixText, int count)
{
List<NamenameCollection = Name.GetNames(prefixText, count);
List<stringnames = null;
foreach (Name name in nameCollection)
{
names.Add(name.surename);
}
return names.ToArray();
}

}

could it be caused by this: ServicePath="~/Services/AutoCompleteName.asmx"
in the video source code it is ServicePath="AutoCompleteName.asmx", but
I've created a subfolder for my .asmx files just in case my project will
have more .asmx files. I thought it was a nice way of keeping the project
tidy, not having everything in the root folder.....

any suggestions?
Don't you need to uncomment the ScriptService attribute?

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Nov 21 '08 #2
thanks that solved the problem
Nov 21 '08 #3

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

Similar topics

12
by: Bill | last post by:
For my personal use I am accessing a railway timetable page, parsing its contents and then sending brief relevant information as the subject line of an email to be read on a mobile phone. The...
1
by: Steve Allgood | last post by:
I'm having trouble posting a form at the USPS web site. I've been successful using urllib at other sites, but I'm missing why this won't work: # begin code # get zip+4 import urllib def...
3
by: Jason | last post by:
I am having trouble using the CONTAINS function in sql server(enterprise manager). I am typing the following: Select * FROM mytable WHERE CONTAINS(myfield,'mystring') This returns the...
2
by: Matthias Kaeppler | last post by:
Hello, I am having trouble getting std::equal_range to perform as I wish, and I can't find my error. Here's the situation: I have a vector of pointers to filesystem path objects (a file list,...
6
by: Gary Morris | last post by:
Hi all, I tried posting this through a free news server, but it still has not appeared in Google, so if it turns up again I apologize. I hope someone can help me with this, or at least help...
5
by: tkondal | last post by:
Hi all. I just started looking at Python's ctypes lib and I am having trouble using it for a function. For starters, here's my Python code: from ctypes import*; myStringDLL=...
9
by: Nathan Sokalski | last post by:
I am trying to use the System.Array.ForEach method in VB.NET. The action that I want to perform on each of the Array values is: Private Function AddQuotes(ByVal value As String) As String Return...
1
by: mikeh3275 | last post by:
I have a header control that I include in my .aspx page. In this control, I'm trying to retrieve a cookie value and store it into a string, but I am receiving an "Object reference not set to an...
1
by: alag20 | last post by:
Hi guys, i am having trouble importing c++ unmanaged dll into C# . Can someone help? Basically i am just trying to create a safearray of strings in c++ and trying to send it to C#. Here is my...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.