Why I can access Session object in Page_Load method in instance of System.Web.UI.Page, but I can’t do it in other places?
public partial class Statystyki : System.Web.UI.Page
{
// Session object not allowed here
protected void Page_Load (object sender, EventArgs e)
{
// but allowed here
}
}
And not allowed in custom classes. How to get reference to this object from own class?
You can access it in custom classes like this