Tải bản đầy đủ (.pdf) (10 trang)

Professional ASP.NET 3.5 in C# and Visual Basic Part 156 doc

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (566.71 KB, 10 trang )

Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1515
Chapter 33: Administration and Management
Figure 33-18
Figure 33-19
1515
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1516
Chapter 33: Administration and Management
Changes you are making in the IIS Manager are actually being applied to the
web.config
file of your
application; making changes to the Default Web site (the root node) lets you edit the
machine.config
file.
Figure 33-20
Figure 33-21
The dialog enables you to change the following items:
❑ Web site name: The name of the Web site. In the case of Figure 33-22, naming the Web site
‘‘Wrox’’ means that the URL will be
http://[IP address or domain name]/Wrox
.
1516
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1517
Chapter 33: Administration and Management
Figure 33-22
❑ Application pool: The application pool you are going to use for the application. You will notice
that you have three options by default — DefaultAppPool (which uses the .NET Framework 2.0
and an integrated pipeline mode), Classic .NET AppPool (which uses the .NET Framework 2.0
and a classic pipeline mode), and ASP.NET 1.1 (which uses the .NET Framework 1.1 as it
states and a classic pipeline mode).
❑ Physical path: The folder location where the ASP.NET application can be found. In t his case, it is
C:


\
Wrox
.
The sections that follow review some of the options available to you through the icons in the IIS Manager.
.NET Compilation
Use the Application tab to make changes that are more specific to the pages in the context of your appli-
cation. From this dialog, shown in Figure 33-23, you can change how your pages are compiled and run.
You can also make changes to global settings in your application.
This section deals with compilation of the ASP.NET application as well as how some of the pages of the
application will behave. The Batch section deals with the batch compilation of the application — first,
whether or not it is even supported, and then details on batch sizes and the time it takes to incur the
compilation.
The Behavior section deals with whether or not the compilation produces a release or debug build; you
will also find some Visual Basic–specific compilation instructions on whether Option Explicit or Option
Script are enabled across the entire application.
1517
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1518
Chapter 33: Administration and Management
Figure 33-23
The General section focuses on the assemblies that are referenced as well as your code subdirectories
if you are going to break up your App_Code folder into separate compiled instances (required for when
you want to incorporate Visual Basic and C# code in the same application). You can also specify the
default language that is used in the compilation process — such as
VB
or
C#
.
.NET Globalization
The .NET Globalization option enables you to customize how your ASP.NET application deals with
culture and the encoding of the requests and responses. Figure 33-24 shows the options available in this

section.
In addition to picking a specific Culture or UI Culture setting, you can also select Auto Detect, which
will pick up the culture of the client if it is available. By default, you can also see that the encoding of the
requests and the responses are set t o
utf-8
, which will work fine for most Latin-based languages.
.NET Profile
The .NET Profile options enable you to customize how your ASP.NET application deals with the ASP.NET
personalization system. This system was discussed earlier in Chapter 15 of this book. Figure 33-25 shows
the dialog that is provided when you add a new profile to the personalization system.
1518
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1519
Chapter 33: Administration and Management
Figure 33-24
Figure 33-25
In this case, as presented in Figure 33-25, you can specify the name of the personalization property, the
data type used, its default value, how it is serialized, and whether or not it is read-only or available for
anonymous users. To better understand these settings, it is important to review Chapter 15.
In addition to building properties to use in the personalization system, you can also specify the provider
that is used by the system as a whole. By default, it will be using the AspNetSqlProfileProvider, as illus-
trated in Figure 33-26.
1519
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1520
Chapter 33: Administration and Management
Figure 33-26
.NET Roles
You can enable role-based management by adding roles to your application from the .NET Roles section.
Figure 33-27 shows an example of adding a role called Admin to the application.
Figure 33-27
Pressing OK will add the role to the system and the role will then be shown in a list of roles from the

main screen of the section, as illustrated in Figure 33-28.
Figure 33-28
By default, there will be no users added to the role. You will be able to add users to roles through the
.NET Users section, discussed shortly.
.NET Trust Levels
The .NET Trust Levels section allows you to specify the level of security to apply to your application
through the selection of a specific pre-generated configuration file. This is illustrated in the list of options
presented in Figure 33-29.
1520
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1521
Chapter 33: Administration and Management
Figure 33-29
By default, your application makes use of the
web.config
file, but specifying a different trust level will
cause the application to use a different
.config
file. All of these
.config
files are found at
C:
\
Windows
\
Microsoft.NET
\
Framework
\
v2.0.50727
\

CONFIG
.
.NET Users
Probably one of the easiest ways to work with the ASP.NET membership system (covered in Chapter 16
of this book) is to create your users in the .NET Users section of IIS. Adding a user is easy through the
dialogs provided, as illustrated in Figure 33-30.
Figure 33-30
In Figure 33-30, you can provide the username, password, and security question and answer in a simple
wizard. Figure 33-31 shows the second screen of the wizard.
1521
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1522
Chapter 33: Administration and Management
Figure 33-31
In this second screen of the wizard, you can assign users to specific roles that are present in the role
management system. Because the Admin role was created earlier in this chapter, I am able to assign the
user to this particular role as it exists in the system.
Once a user is created, you can then see the entire list of users for this particular application from the
main .NET Users screen, as illustrated in Figure 33-32.
Figure 33-32
Application Settings
Another section is the Application Settings section. Click its Add or Edit button, and the Edit/Add
Application Settings dialog opens (see Figure 33-33).
1522
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1523
Chapter 33: Administration and Management
Figure 33-33
After you enter a key and value pair, click OK; the settings appear in the list in the main dialog. Then you
can edit or delete the settings from the application.
Connection Strings
The next section is the Connection Strings section. To add a connection string to your application, just

click its Add b utton. You also can edit or remove existing connection strings. Figure 33-34 shows the Edit
Connection String dialog for the default connection string — LocalSqlServer.
Figure 33-34
It is also rather simple to add a brand n ew connection, as illustrated in Figure 33-35.
1523
Evjen c33.tex V2 - 01/28/2008 4:18pm Page 1524
Chapter 33: Administration and Management
Figure 33-35
Pages and Controls
The Pages and Controls section deals with a group of settings that control the overall ASP.NET pages
(
.aspx
) and user controls in the application (
.ascx
). Figure 33-36 shows the available settings for this
section.
Providers
The Providers section deals with all the providers that are defined within the application. From the
example in Figure 33-37, you can see that there are only two providers defined for the .NET Roles
engine — a SQL Server role provider and a Windows Token role provider.
You can look at all the other engines found in ASP.NET by selecting the option in the drop-down list at
the top of the dialog.
Session State
ASP.NET applications, being stateless in nature, are highly dependent on how state is stored. The Session
State section (see Figure 33-38) enables you to change a number of different settings that determine how
state management is administered.
1524

×