Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ASP .NET 2.0 Beta Preview - B. Evjen.pdf
Скачиваний:
26
Добавлен:
24.05.2014
Размер:
15.33 Mб
Скачать

Administration and

Management

The exciting 2.0 version of ASP.NET adds a lot of punch to developer productivity. In addition to incorporating a lot of common Web site functionality, new features in ASP.NET make it easier to manage ASP.NET applications. These new ASP.NET administration and management capabilities are designed to fill the pressing needs of developers. This chapter introduces the new management dialogs for working with ASP.NET applications that run on IIS, as well as showing you the new ASP.NET Web Site Administration Tool.

The MMC ASP.NET Snap-In

One great new addition to ASP.NET management is the ASP.NET tab in the Microsoft Management Console if you are using IIS for the basis of your ASP.NET applications. To get at this new ASP.NET tab, open IIS and expand the Web Sites folder. This folder shows a list of all the Web sites configured to work with IIS. Remember that not all of your Web sites are configured to work in this manner. It is also possible to create ASP.NET applications that make use of the new ASP.NET built-in Web server.

After you find the application you are looking for in the Web Sites folder, right-click that application and select Properties (see Figure 14-1).

Selecting the Properties option brings up the MMC console. The far-right tab is the ASP.NET tab. Click this tab to get the results shown in Figure 14-2. You should also note that selecting one of the application folders lets you edit the web.config file from the MMC snap-in; selecting Properties for the default Web site (the root node) lets you edit the machine.config file.

Chapter 14

Figure 14-1

Figure 14-2

388

Administration and Management

The top configuration panel for ASP.NET enables you to change the following items:

ASP.NET Version: The .NET Framework version number on which the ASP.NET application is to run. Be careful about switching versions of the application. Some minor breaking changes may cause errors in different versions of the framework.

Virtual path: The virtual path of the application. In this case, Visual Studio creates an application titled MyIISApp with a MyIISApp virtual directory.

File location: The location of the file being altered by the MMC console. In most cases, these configuration GUIs alter the web.config file. In this case, the file location is the web.config file in the MyIISApp application.

File creation date: The date when the web.config file was created.

File last modified: The date when the web.config file was last modified either manually, using the MMC console, or by the ASP.NET Web Site Administration Tool.

In addition to these items, the ASP.NET tab also includes an Edit Configuration button that provides a tremendous amount of modification capabilities to use in the web.config file. When you click this button, you see a multitabbed GUI titled ASP.NET Configuration Settings. The following sections review each of the tabs available to you through this MMC console.

General

The first tab, labeled General, enables you to manage connection strings and app settings for your application. Figure 14-3 shows an example of one setting for an application.

Figure 14-3

389

Chapter 14

The General tab has two sections. One is for adding, editing, or removing connection strings; the other is for adding, editing, and removing app settings. Both of these items work with name/value pairs. If you choose to add a connection string to your application, click the Add button in the top section (Connection String Manager) to see the dialog in Figure 14-4.

Figure 14-4

The Edit/Add Connection String dialog asks for the Name and the Connection Parameter for the connection string. Supplying this information and clicking OK provides your application with a connection string.

If you select the Edit/Add buttons in the bottom section (App Settings), you see the dialog shown in Figure 14-5.

Figure 14-5

The Edit/Add Application Settings dialog asks for a Key and Value pair. After you add these items and click OK, the settings appear in the list in the main dialog. You can now either edit or delete the settings from the application.

Custom Errors

The second tab is the Custom Errors tab. This section of the console enables you to add custom error pages or redirect users to particular pages when a specific error occurs in the application. Figure 14-6 shows an example of the Custom Errors tab.

390