我使用AutoCompleteExtender从Ajax控件工具包,它是stragely行为。Ajax控件工具包AutoCompleteExtender剥离零和未来与幻象值
我的服务方法如下所示:
[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;
}
,它工作正常,如果我的价值观调用它的测试页getEJMaps(“00056”,4)我得到这些结果:
00056399
00056717
00056721
00056722
00056900
...
这就是我想要的东西,但是当我把它绑在文本框和类型在00056,我得到的结果:
56399
24015
24017
56717
56721
...
这说明两个问题:
- 到底发生到我的零是什么?我怎样才能让他们回来?
- 这些“240xx”数字来自哪里?甚至在xml文档中都没有这些值!
我完全被这个难住了,请帮我:)
他们都串 - 这是奇怪的一部分; 我放弃了工具包,并用jQuery代替http://naspinski.net/post/Using-jqueryautosuggestjs-with-AspNet.aspx – naspinski 2009-02-04 06:11:15