Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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 .
C#
[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!!!!!!!!
Posted
Updated 22-May-12 1:27am
v2

1 solution

To read this value as string Just add double quote (") before and after values
ie String array look like {"/"9/3/"","/"3/22/"","/"3/22e/""}
and change my Web service as
C#
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();
       
   }

Now java script read "/"3/22/"" as string
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900