本文介绍了ASP.NET 3.5中的Ajax自动完成扩展器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单中使用Ajax自动完成扩展器.当用于自动完成的数组的值如{"9/3","3/22","3/22e"}}在表单弹出窗口中具有值3 ,0.1363636363,3/22e插入了"9/3","3/22","3/22e".值"9/3","3/22"等不是日期.它们是我形式的外键.用于自动完成的Web服务.

I am using an Ajax auto completion extender in my form.When Array for auto completion has value like {"9/3","3/22","3/22e"} auto completion in form popup with values 3,0.1363636363,3/22e insted of "9/3","3/22","3/22e".Values "9/3","3/22" etc are not dates .they are foreign keys in my form . Web service using for auto completion .

[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        return (from m in ycode where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();

    }



请提出解决此问题的方法
紧急!!!!!!!



Please suggest a solution for this problem
Urgent!!!!!!!!

推荐答案

public static string[] GetCompletionList2(string prefixText, int count, string contextKey)
   {
       return (from m in fabcode where m.StartsWith("\""+prefixText, StringComparison.CurrentCultureIgnoreCase) select @m).Take(count).ToArray();
       
   }


现在,Java脚本以字符串形式读取"/" 3/22/""


Now java script read "/"3/22/"" as string


这篇关于ASP.NET 3.5中的Ajax自动完成扩展器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 18:41