473,395 Members | 2,006 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,395 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 4953


"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...
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: 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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.