tags:

views:

170

answers:

2

I added some custom fields (public booleans) to the global class in global.asax.cs which are initialized during the Application_Start event. How do I access them in a webhandler (ashx)? Or is it better to save them in the Application state object?

+1  A: 

You would probably need to access the class as the type that your Global.asax.cs is rather than the type it is inheriting from.

I believe it is more common to just use the Application State object for application wide variables.

Jeff Martin
public class global : System.Web.HttpApplicationSo the class I'm editing is called global, but how do I get to the instance of it from a webhandler, is my question. Thanks for the advice so far.
Michiel Borkent
A: 

have you tried ((global)Application).PublicBooleanField ?

Jeff Martin