if i create my enum class in the global.ascx in MVC, is there a way i can call that class from a controller.
ie
i do this in my global.ascx class volume myVolume = volume.Low
is there a开发者_高级运维 way i can find out what i set myVolume to from a controller.
Scope of variables check that it is accessable, then use
MvcApplication.MyEnumProperty = MvcApplication.EnumType.EnumValue
Note: its a standard class so the property will need to be defined as static or you could wrap in a singleton, your call, so that all controllers can reach it. Session might be a better place to store the value.
精彩评论