草庐IT

EnableSession

全部标签

c# - 如何在网络方法中访问 session ?

我可以在WebMethod中使用session值吗??我试过使用System.Web.Services.WebMethod(EnableSession=true)但我无法访问像inthisexample这样的session参数:[System.Web.Services.WebMethod(EnableSession=true)][System.Web.Script.Services.ScriptMethod()]publicstaticStringchecaItem(Stringid){return"zeta";}这里是调用webmethod的JS:$.ajax({type:"POST

c# - 如何在网络方法中访问 session ?

我可以在WebMethod中使用session值吗??我试过使用System.Web.Services.WebMethod(EnableSession=true)但我无法访问像inthisexample这样的session参数:[System.Web.Services.WebMethod(EnableSession=true)][System.Web.Script.Services.ScriptMethod()]publicstaticStringchecaItem(Stringid){return"zeta";}这里是调用webmethod的JS:$.ajax({type:"POST