1.要在一般处理程序中获取其他页面的session值,需要引用名空间:

using System.Web.SessionState;

2.然后继承一个接口:IRequiresSessionState,如图:

2017-6-16  ajax中获取session对象


3.然后就可以获得session值了:

HttpContext context = new HttpContext();

string s =context.Session["Verifycode"].ToString();
 
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2021-12-05
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案