Ajax Control Toolkitの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
...
これはまさに私が望むものですが、それをTextBoxに関連付けて 00056 と入力すると、結果が得られます。
56399
24015
24017
56717
56721
...
これは2つの問題を示しています:
- 私のゼロはどうしたの?どうすればそれらを取り戻すことができますか?
- それらの「240xx」番号はどこから来たのですか? これらの値を持つxmlドキュメントには何もありません!
私はこれに完全に困惑しています、助けてください:)