473,322 Members | 1,307 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,322 software developers and data experts.

AutoCompleteExtender doesn't work

I tried using the

AutoCompleteExtender sample code below but it doesn't seem to work.
I'm not using a ServicePath="GetCompletionList.asmx"
But the textbox doesn't return anything either does it trigger
Any ideas and thanks in advance

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:TextBox runat="server" ID="myTextBox" Width="300" autocomplete="off" />
<ajaxToolkit:AutoCompleteExtender runat="server"
ID="autoComplete1"
TargetControlID="myTextBox"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="1"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="12" />
</form>

public partial class _Default : System.Web.UI.Page {
[WebMethod]
public static string[] GetCompletionList(string prefixText, int count) {
string sql = String.Format("select companyName from customers where
companyname like @companyname + '%'");

List<stringcompanyList = new List<string>();
using (SqlConnection connection = new SqlConnection("Integrated
Security=SSPI;Initial Catalog=Northwind;Data Source=."))
using (SqlCommand command = new SqlCommand(sql, connection)) {
connection.Open();
command.Parameters.AddWithValue("@companyname", prefixText);
using (SqlDataReader reader = command.ExecuteReader()) {
while (reader.Read()) {
companyList.Add(reader.GetString(0));
}
}
}

return companyList.ToArray();
}
Jun 1 '07 #1
0 1752

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

Similar topics

0
by: Jay | last post by:
I'm using AutoCompleteExtender provided by the Atlas framework. I also created a user control which contains a textbox and AutoCompleteExtender which supports auto complete for the textbox. The...
0
by: ack95 | last post by:
i am at a loss. i have been using the AutoCompleteExtender up until RC1. Now it is completely unresponsive and doesn't even throw a javascript error. I have added these sections to the config...
11
by: =?Utf-8?B?VHJlbnQ=?= | last post by:
I have tied an AutoCompleteExtender to a textbox to indicate suggestions to the user. Everything works fine if I utilize a webservice to fetch the results. However, I want to put the web service...
0
by: riazs | last post by:
Guys, I don't know if I'm in the correct forum... anyway here goes: Does anyone else get the Access Denied error when typing text into a text box which is linked to an AutoCompleteExtender. ...
1
by: shapper | last post by:
Hello, I am using an AutoCompleteExtender. I created the .asmx file with the method GetWordList: <WebMethod()_ Public Function GetWordList(ByVal prefixText As String, ByVal count As Integer)...
0
by: askaquest | last post by:
Hello, I am using AutoCompleteExtender.The program Run without any errors.But It doesn't show suggestions bellow the textBox. My aspx page is as follows: <form id="form1" runat="server"> ...
0
by: rote | last post by:
When i type in a word the webservice doesn't retrieve anyhthing its just blank any ideas what 'm doing wrong? My Snippet code below. In my store proc i have like below : select firstname from ...
4
by: Peter | last post by:
ASP.NET 2.0 I have an AutoCompleteExtender which works fine- I am using name, id pair in the WebService , but what I am trying to do is: once the user selects an item from the...
2
by: Jeff | last post by:
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.