Click here to Skip to main content
15,117,549 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using webservice for autocomplete that will use in textbox to fetch data from the database but when i try to use session in the below function it will not accessble for me even i have try to store the session variable in global variable but the variable is also not accessable but when i replace "List<string>" with "string[]" it will work fine but then the function will not work so help me to accerss the session variable.

[WebMethod, ScriptMethod]
C#
   public static List<string> GetCountries(string prefixText)
   {
}
Posted
Updated 6-Apr-12 2:04am
v2

1 solution

By default, session is not available in WebService calls. Use this instead
C#
[WebMethod(EnableSession = true)]
   
Comments
sharad_sharma82 6-Apr-12 10:28am
   
i have already tryed that but its not working for me :(
ZurdoDev 6-Apr-12 10:35am
   
You sure you have EnableSession = true? If so, you will have to share more information.

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