0% found this document useful (0 votes)
198 views2 pages

ASP.NET Web Config Guide

A web configuration file is used to manage various settings that define a website such as database connections, caching settings, session states, error handling, and security. The configuration file is an XML file separate from application code. To create a web configuration file, a new text file is made and saved as webconfig.conf. The file is then added to the website created in Visual Studio.Net. Settings in the file can then be changed by opening it in a text editor. The sample code provided shows connection strings for two databases along with compilation and authentication settings.

Uploaded by

Naveenesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
198 views2 pages

ASP.NET Web Config Guide

A web configuration file is used to manage various settings that define a website such as database connections, caching settings, session states, error handling, and security. The configuration file is an XML file separate from application code. To create a web configuration file, a new text file is made and saved as webconfig.conf. The file is then added to the website created in Visual Studio.Net. Settings in the file can then be changed by opening it in a text editor. The sample code provided shows connection strings for two databases along with compilation and authentication settings.

Uploaded by

Naveenesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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=&quot;F:
urce=&quot;F:\Jerald\WEB APPLICATIONS\db\[Link]&quot;"
[Link]&quot;"
providerName="[Link]" />
<add name="courseConnectionString2"
connectionString="Provider=[Link].4.0;
Data Source=&quot;F:
Source=&quot;F:\Jerald\WEB APPLICATIONS\db\course
[Link]&quot;"
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

You might also like