How do I display AppSettings in an ASP.NET MVC web application?

asp.net-mvc

Solution

You should be able to just use

<%=  ConfigurationManager.AppSettings["FileServer"] %>

in your View.

By the way, `ConfigurationSettings` is deprecated - you should use `ConfigurationManager`

Problem

I need to display a value from the `web.config` `appSettings` section into a view. I am using `<%= Html.Label %>` to populate In ASP.NET, I'd use `ConfigurationSettings.AppSettings["FileServer"]`. How do I do this in MVC??

Original source