unknownUser
unknownUser

Reputation: 125

How to initialize a variable in global.asax and use it within other controllers

I implemented a variable in global.asax and I would like to use it within other controllers. Thank you in advance.

Upvotes: 0

Views: 1006

Answers (1)

Radislav
Radislav

Reputation: 2983

If your varialbe is static you can use this sintax - MvcApplication.VarName. Where MVCApplication your main class inherited from System.Web.HttpApplication, and VarName - your variable name.

Upvotes: 1

Related Questions