H
Hardy Wang
Hi,
I have a web application, code of ASPX page needs to call one static
method in another class which does not inherit System.UI.Page class
using System.Web;
public class Utils {
public static void GetSessions() {
HttpContext ctx = HttpContext.Current;
ctx.Session; // not available. <undefined value>
ctx.Cache; // Yes!! I can access.
}
}
If I place a quick watch on ctx variable, I noticed Session is not
availble to use, but Cache is ready.
Anybody has idea how can I access Session objects from other class? And
why I cannot access it via HttpContext?
Thanks for any suggestion.
I have a web application, code of ASPX page needs to call one static
method in another class which does not inherit System.UI.Page class
using System.Web;
public class Utils {
public static void GetSessions() {
HttpContext ctx = HttpContext.Current;
ctx.Session; // not available. <undefined value>
ctx.Cache; // Yes!! I can access.
}
}
If I place a quick watch on ctx variable, I noticed Session is not
availble to use, but Cache is ready.
Anybody has idea how can I access Session objects from other class? And
why I cannot access it via HttpContext?
Thanks for any suggestion.