Setting and Using application variables in .NET MVC
April 29, 2019
- You do that in
Web.config - You can have multiple config files for differnt setups, for example:
Web.alpha.config,Web.beta.config,Web.Release.configandWeb.config
code
<configuration>
<appSettings>
<add key="PayPalReturnUrl" value="http://blah.com/subscribe/paypal-response" />
</appSettings>
</configuration>
code
@using System.Configuration
private static readonly string C_REDIRECT_URL = ConfigurationManager.AppSettings["PayPalReturnUrl"];