Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Build Your Own ASP.NET 2.0 Web Site Using CSharp And VB (2006) [eng]-1.pdf
Скачиваний:
143
Добавлен:
16.08.2013
Размер:
15.69 Mб
Скачать

Chapter 1: Introducing ASP.NET and the .NET Platform

Custom Errors

This option allows you to define your own custom error

 

pages. Rather than presenting the standard error mes-

 

sages that appear within Internet Explorer, you can

 

customize error messages with your company’s logo

 

and messages of your choice.

ASP.NET

This tab allows you to configure the options for the

 

ASP.NET applications stored in that folder.

One thing to note at this point is that we can set properties for the Default Web Site node, and choose to have them “propagate” down to all the virtual directories we’ve created.

Using Cassini

If you’re stuck using a version of Windows that doesn’t support IIS, you’ll need to make use of Cassini to get your simple ASP.NET web applications up and running. Cassini doesn’t support virtual directories, security settings, or any of IIS’s other fancy features; it’s just a very simple web server that gives you the basics you need to get up and running.

To get started using Cassini:

1.Create a directory called C:\WebDocs\Learning, just like the one we created in the section called “Virtual Directories”.

2.Copy index.htm into this folder. We first saw index.htm in the section called “Using localhost”.

3.Start Cassini by opening C:\Cassini (or, if you chose to install Cassini somewhere else, open that folder), then double-click on the file CassiniWebServer.exe.

4.Cassini has just three configuration options:

Application Directory

It’s here that your application’s files are stored. Enter C:\WebDocs\Learning into this field.

Server Port

Web servers almost always operate on port 80, so we won’t touch this setting.

20

Configuring the Web Server

Virtual Root

This is similar to IIS’s virtual directories feature, though it’s nowhere near as flexible. By default, it’s set to /, meaning that you can access the file C:\WebDocs\Learning\index.htm by entering the address http://localhost/index.htm. However, to match our IIS virtual directory configuration, we want to make this file’s address http://localhost/Learning/index.htm. To create this effect, enter /Learning/ into this field.

5.Once you have filled in the Application Directory and Virtual Root fields, click the Start button to start the web server.

6.After clicking Start, a link to the web site that’s being served will appear toward the bottom of the window, as shown in Figure 1.11.

Figure 1.11. Cassini serving a web site

When you browse open this site in Cassini, you won’t see index.htm straight away—you’ll be presented with a list of files instead. Cassini only recognizes files named default.htm or default.aspx as default documents, and it doesn’t allow you to configure this feature as IIS does.

21