I'm a beginner with C#, .net etc., and I am working with a MVC Web Application.
I saw some examples where, in Application_Start()
in Global.asax.cs, people use Application.Add("prop", "value")
to store values from Web.config.
Then we can access it in the controllers, through HttpContext.Application["prop"]
.
Is there a difference between using
HttpContext.Application["prop"]
and using
WebConfigurationManager["prop"]
?
I think in this page: http://msdn.microsoft.com/en-us/library/system.web.configuration.webconfigurationmanager.aspx it is advised to use WebConfigurationManager
for Web applications, but they don't talk about HttpContext.Application
.
Thanks a lot!