EXERCISE 1 : WEB CONFIGURATION FILE
AIM : To Create a webconfiguration file and use it in [Link] Web Site.
EXPLANATION:
Configuration file is used to manage various settings that define a website. The
settings are stored in XML files that are separate from the application code.
Generally a website contains a single [Link] file stored inside the application
root directory. However there can be many configuration files that manage settings at
various levels within an application.
Some of the most frequently used configurations, stored conveniently inside
[Link] file are:
• Database connections
• Caching settings
• Session States b5 17 46
• 181 23 70
• Error Handling
• Security
• Details of user controls and custom controls used in project
STEPS:
Step 1 : Create a New Text file using Notepad (or any text editor)
Step 2 : Create a Xml file as in the following source code
Step 3 : Save the file as [Link]
Step 4 : Add the webconfig file to the website created using Visual [Link]
Step 5 : For changes in the webconfig file, Open the file in Text Editors (Notepad,
Wordpad etc.) and make necessary changes.
F:\Jerald\WebApp\Ex 1 [Link] Arokiadass Jerald Page 1 of 2
SOURCE CODE :
<?xml version="1.0"?>
<!-- For more information on how to configure your [Link] application, please visit
[Link] -->
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS; Integrated Security=SSPI;
AttachDBFilename=|DataDirectory| [Link];User Instance=true"
AttachDBFilename=|DataDirectory|\[Link];User
providerName="[Link]" />
<add name="courseConnectionString"
connectionString="Provider=[Link].4.0;
Data Source="F:
urce="F:\Jerald\WEB APPLICATIONS\db\[Link]""
[Link]""
providerName="[Link]" />
<add name="courseConnectionString2"
connectionString="Provider=[Link].4.0;
Data Source="F:
Source="F:\Jerald\WEB APPLICATIONS\db\course
[Link]""
providerName="[Link]" />
</connectionStrings>
<[Link]>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms loginUrl="~/Account/[Link]" timeout="2880"/>
</authentication>
</[Link]>
<[Link]>
<modules runAllManagedModulesForAllRequests="true"/>
</[Link]>
</configuration>
OUTPUT
F:\Jerald\WebApp\Ex 1 [Link] Arokiadass Jerald Page 2 of 2