I am using the AutoCompleteExtender from the Ajax Control Toolkit and it is behaving stragely.
My service method is shown here:
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[] getEJMaps(string prefixText, int count)
{ // method that returns the auto-suggest for the EJMaps positions
string file_location = HttpContext.Current.Server.MapPath("~") + Utils.Settings.Get("attachments") + "ejmaps\\ejmaps.xml";
XElement x = XElement.Load(file_location);
string[] positions = (from p in x.Descendants("position") where p.Value.StartsWith(prefixText) orderby p.Value select p.Value).ToArray();
if (positions.Count() == 0)
return new string[] { "No Matching Results" };
else return positions;
}
And it works fine, if I call it in a test page with the values getEJMaps("00056", 4) I get these results:
00056399
00056717
00056721
00056722
00056900
...
Which is exactly what I want, but when I tie it to a TextBox and type in 00056, I get the results:
56399
24015
24017
56717
56721
...
Which shows two problems:
- What the hell happened to my zeroes? ANd how can I get them back?
- Where did those "240xx" numbers come from? There aren't even any in the xml document with those values whatsoever!
I am totally baffled by this, please help me out :)