Imagine I have a property defined in global.asax.
public List<string> Roles
{
get
{
...
}
set
{
...
}
}
I want to use the value in another page. how to I refer to it?
You can access the class like this:
((Global)this.Context.ApplicationInstance).Roles
It looks to me like that only depends on the session - so why not make it a pair of static methods which take the session as a parameter? Then you can pass in the value of the "Session" property from the page. (Anything which does have access to the HttpApplication can just reference its Session property, of course.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With