Possible Duplicate:
How do you access application variables in asp.net mvc 3 razor views?
Is it possible to access application variable in controller using asp.net mvc2.0
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For example, in global.asax:
In any controller method:
Update (7/2018):
If you need to access MVC global application data from a DLL library:
It is safer to check HttpContext.Current.Application against null as well, because some fake httpcontext library (used in unit test projects) could have a valid context with null “Application”.