启用可会话会话 [英] Enable to acess the session bariable

查看:80
本文介绍了启用可会话会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用网络服务进行自动完成,该服务将在文本框中用于从数据库中获取数据,但是当我尝试在以下函数中使用会话时,即使我尝试将会话变量存储在全局变量中,它也无法为我使用,但是该变量也是不可访问的,但是当我替换"List< string>"时使用"string []"可以正常工作,但是该功能将无法工作,因此请帮助我增加会话变量.

[WebMethod,ScriptMethod]

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]

   public static List<string> GetCountries(string prefixText)
   {
}

推荐答案

默认情况下,WebService调用中不提供会话.请改用此
By default, session is not available in WebService calls. Use this instead
[WebMethod(EnableSession = true)]


这篇关于启用可会话会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆