Beruflich Dokumente
Kultur Dokumente
0 using
MMC
This page is specific to:.NET Framework Version:2.03.03.54.0
ASP.NET Configuration
Walkthrough: Configuring ASP.NET Applications in IIS 6.0 using MMC
ASP.NET enables you to make configuration settings for applications that are running in
Internet Information Services (IIS) 6.0. You can make configuration settings in the
following ways:
• With the Web Site Administration Tool, lets Web site owners manage Web sites
either locally or remotely. For more information, see ASP.NET Web Site
Administration Tool.
• By using the configuration API to manage settings programmatically. For more
information, see ASP.NET Configuration API Overview.
• By using the ASP.NET Microsoft Management Console (MMC). MMC enables
an administrator on the server to make configuration settings for all Web sites or
for a specific Web site. Unlike the Web Site Administration Tool, MMC gives
you control over the complete configuration hierarchy for the Web server.
In this walkthrough, you will explore MMC. You will add an application setting to a
single Web site that will store a value that represents the background color of a Web
page. You will then create an ASP.NET Web page that uses the application setting that
you are making. Although the task that you accomplish with MMC in this walkthrough is
not complex, it serves as an introduction to how to work with the ASP.NET MMC.
Note:
When you use the IIS MMC snap-in to configure a remote server, the ASP.NET
Configuration Settings dialog box is not available.
Prerequisites
In the first part of the walkthrough, you will create a folder for your Web pages and use
Internet Information Services (IIS) Manager to create a virtual directory to which it
points.
1. On your computer, create a folder to hold the files for your Web site.
6. Click Next.
7. In the Alias box, type a name for the site such as SampleWebSite, and then click
Next.
8. In the Path box, enter the path for the folder you created in step 1, and then click
Next.
9. Select the Read and Run scripts check boxes, click Next, and then click Finish.
You can now use the ASP.NET MMC to make settings for the Web site.
1. In Internet Information Services (IIS) Manager, right-click the name of your new
virtual directory, and then click Properties.
Note:
Leave the Internet Information Services (IIS) Manager open.
The ASP.NET MMC is a graphical tool for editing ASP.NET configuration files. In this
walkthrough, you are editing configuration settings for a single Web application,
meaning that you are editing the Web.config file for the Web site that you created at the
beginning of the walkthrough. You will now verify the setting that you have made in the
ASP.NET MMC by examining the Web.config file.
1. In Windows Explorer, navigate to the folder that you created at the beginning of
the walkthrough.
The folder now contains a Web.config file. When you created configuration
settings for the Web site, MMC created a new Web.config file, because one did
not exist before.
MMC created the <appSettings> element to hold the key/value pair that you
defined.
You can now test the application setting you created with MMC by creating a Web page
that uses the setting.
1. In the folder that you created at the beginning of the walkthrough, create a new
text file and name it Default.aspx.
You can edit the file using any text editor, such as Notepad.
2. Copy the following code into the Default.aspx page.
VB C# C++ F# JScript
<html >
<head>
<title>Sample Web Application</title>
</head>
<body style="background-color:<%=CustomBGColor%>">
<form runat="server" id="Form1">
Body background color:
<%=CustomBGColor%>
</form>
</body>
</html>
http://localhost/SampleWebSite/Default.aspx
You can use the ASP.NET MMC to change existing settings as well.
http://localhost/SampleWebSite/Default.aspx