ASP.NET - Read Settings from web.config



Read connection string settings from web.config

 //gets key value from config file 
using System.configuration;
string s =ConfigurationManager.AppSettings["key"];

Store the connection string in web.config settings

//sets the common key values
<appSettings>
<add key="FilePath" value="../Code/SyntaxHelp"/>
<add key="FromMailID" value="support@syntaxhelp.com"/>
</appSettings>
</pre>

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.