Here's the easy way to get access to the web.config settings anywhere in your C# project.
Properties.Settings.Default
Use case:
litBodyText.Text = Properties.Settings.Default.BodyText;
litFootText.Text = Properties.Settings.Default.FooterText;
litHeadText.Text = Properties.Settings.Default.HeaderText;
Web.config file:
<applicationSettings>
<myWebSite.Properties.Settings>
<setting name="BodyText" serializeAs="String">
<value>
<h1>Hello World</h1>
<p>
Ipsum Lorem
</p>
</value>
</setting>
<setting name="HeaderText" serializeAs="String">
My header text
<value />
</setting>
<setting name="FooterText" serializeAs="String">
My footer text
<value />
</setting>
</myWebSite.Properties.Settings>
</applicationSettings>
No need for special routines - everything is right there already. I'm surprised that no one has this answer for the best way to read settings from your web.config file.