[RESOLVED] Web.config > adding a support email for the entire site.
The book mentions adding the line:
<appSettings>
<add key="SupportEmail" value="[email protected]" />
</appSettings>
into the web.config file like so, or so I believe:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="SupportEmail" value="[email protected]" />
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
Now, how would you take advantage of that in your web site's pages?
What is the point and how do you make use of it?
Thanks in advance.
Re: Web.config > adding a support email for the entire site.
It means that from anywhere in your application you have access to that email address, so that if it changes at any point in the future all you have to do is make the change to the web.config and not recompile/upload your app.
It can be accessed something like this:
Code:
ConfigurationSettings.AppSettings("SupportEmail");
Re: Web.config > adding a support email for the entire site.
Thank you for the example.