开发者

enum classes MVC calling from controller

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜