I have a web.config file in the directory of a view. When i try to retrieve a value with
ConfigurationManager.AppSettings["xpto"] a null is returned (when the setting really exists).
I have noticed that when i try to retrieve a value from the base web.config (in the project directory) the value is successfully retrieved.
Isn't possible to have multiple Web.config files like in ASP.NET 2.0 WebForms?
The Web.config file exists in the view folder because is presentation logic (associate some
enum values with image url).
miguelfteixe...
Member
2 Points
2 Posts
Access to Web.Config in a view
May 19, 2009 03:55 PM|LINK
Hi.
I have a web.config file in the directory of a view. When i try to retrieve a value with ConfigurationManager.AppSettings["xpto"] a null is returned (when the setting really exists).
I have noticed that when i try to retrieve a value from the base web.config (in the project directory) the value is successfully retrieved.
Isn't possible to have multiple Web.config files like in ASP.NET 2.0 WebForms?
The Web.config file exists in the view folder because is presentation logic (associate some enum values with image url).
Thanks,
Asp.net mvc View AppSettings