I have an autocompleteExtender that I wrote on my dev server and wanted to promote it to my prod server but it won't display the results of my query. I am using framework 3.5 and vs2008 as my ide on both boxes. I can see in debug that the webservice retrieves the data, 100 zipcodes, from the sql2008 database. The webservice gets the results and places them in the arraylist to send back to the calling page but the results never appear. I simply copied the project library from one server to the other and then changed the database references. I am assuming that I have some version issue of os, ajaxcontroltoolkit, framework or something else. On my dev box this works fine.
My autocompleteextender looks like this:
<ajct:AutoCompleteExtender ID="aceZipCode" runat="server" TargetControlID="txtZipCode" EnableCaching="true" CompletionSetCount="100"
CompletionListCssClass="autocomplete_completionListElement" MinimumPrefixLength="3"
CompletionListItemCssClass="autocomplete_listItem" CompletionInterval="300"
CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
ServicePath="~\WebServices\ws_ZipCodes.asmx" ServiceMethod="GetZipCodesStartingWith" />
and my webservice looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.Data.SqlClient;
using System.Web.Services;
using ASAWeb.Business;
namespace ASAWeb.webservices
{
/// <summary>
/// Summary description for ws_ZipCodes
/// </summary>
[WebService(Namespace = "http://tempuri.org/", Description = "Webservice to allow a autocompleter service lookup")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class ws_ZipCodes : System.Web.Services.WebService
{
protected ArrayList Zip_Arraylist = new ArrayList();
protected ASAWeb.Business.ASAdbDataContext data = new ASAWeb.Business.ASAdbDataContext();
[WebMethod]
public ArrayList GetZipCodesStartingWith(string prefixText, int count)
{
//Dictionary<int, ZipCode> dictZipCodes = new Dictionary<int, ZipCode>();// As Dictionary(Of Integer, ZipCode)
//List<string> lstZipCodes = new List<string>();
//List<ZipCode> lstZip = new List<ZipCode>();
try
{
prefixText = prefixText + "%"; //add wildcard to end
//get from the database via stored proc
var zCodes = data.ZipCodes_GetInfoLike(prefixText, count);
foreach (var zc in zCodes)
{
Zip_Arraylist.Add(new string[] { zc.Code + " " + zc.City + ", " + zc.State });
}
}
catch (SqlException ex)
{
throw ex;
}
catch (Exception ex)
{
throw ex;
}
return Zip_Arraylist;
}
}
} Any ideas?