33. Using the Microsoft Expression Development Server

Introduction to the Microsoft Expression Development Server

As sites have evolved, static sites have largely been replaced by dynamic ones that use a server-side technology such as ASP.NET or PHP to provide a more powerful and dynamic user experience.

The following are some of the things you can do using ASP.NET or PHP:

• Display data from a database on a page

• Allow people to create accounts and log in to your site

• Add robust form validation to your web forms

• Add dynamic site navigation

• Take advantage of powerful AJAX features for a better user experience

The likelihood of so many people delving into server-side technologies presents problems because server-side technologies require a web server to run. Although users of Windows XP Professional and many editions of Windows Vista and Windows 7 (and users of any Windows Server edition) have the benefit of a web server included with the operating system, the following Windows editions do not ship with a web server:

• Windows Vista and Windows 7 Starter

• Windows Vista and Windows 7 Home Basic

• Windows Vista and Windows 7 Home Premium

• Windows XP Home Edition

Note

image

The Microsoft Expression Development Server will also work fine on operating systems that ship with a web server.

Tip

image

If the .NET Framework 2.0 or later is installed when you install Expression Web 3, the Microsoft Expression Development Server will be installed by default. If the .NET Framework is not installed before you install Expression Web 3, you’ll need to install the Microsoft Expression Development Server using the Add/Remove Features option in Expression Web 3’s setup program after you install the .NET Framework.

If you’re using one of these operating systems, the Microsoft Expression Development Server enables you to develop and test ASP.NET and PHP applications in Expression Web 3.

Another problem that widespread use of server-side technologies can introduce is more likely to occur in educational environments. Developing with ASP.NET and PHP has traditionally required a user to have administrative access to the web server, but many educational institutions don’t allow users to be administrators. Therefore, developers might not be able to debug applications—and in the worst-case scenarios, they might not be able to run ASP.NET or PHP applications at all.

Both of these problems are nicely solved with the Microsoft Expression Development Server provided with Expression Web 3. The Microsoft Expression Development Server fully supports ASP.NET and PHP, and it enables the development of ASP.NET and PHP applications on all current Microsoft operating systems and by nonadministrators as well.

Note

image

To use ASP.NET, you’ll also need the .NET Framework 2.0 or later. You can download the latest .NET Framework from www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en.

If you’d prefer not to type in that long URL, go to http://download.microsoft.com and search for .NET Framework 3.5. You will easily find the .NET Framework.

To use PHP, you’ll need to install PHP on your computer. You can download PHP from www.php.net.

How to Use the Microsoft Expression Development Server

When you create a site in Expression Web 3, you have many options from which to choose, but the easiest to work with is a disk-based site. However, because a disk-based site doesn’t actually reside on a web server, it doesn’t sit on top of a platform that supports ASP.NET or PHP. That’s where the Microsoft Expression Development Server comes into the picture. The Microsoft Expression Development Server is used by default for all ASP.NET and PHP pages browsed from a disk-based site.

image For more information on creating sites in Expression Web 3, see Chapter 2, “Creating, Opening, and Importing Sites.”

Note

image

The Microsoft Expression Development Server is supported only on disk-based sites.

Expression Web 3 starts the Microsoft Expression Development Server on a random port when an ASP.NET or PHP page is previewed in your browser (see Figure 33.1).

Figure 33.1 The Microsoft Expression Development Server starts automatically when you preview an ASP.NET or PHP page from a disk-based site.

image

You can also use the Microsoft Expression Development Server for all pages. To configure whether the Microsoft Expression Development Server is used only for ASP.NET and PHP pages or for all content, click Site, Site Settings; then click the Preview tab. As shown in Figure 33.2, two options are available for previewing with the Microsoft Expression Development Server:

For Only PHP and ASP.NET Web Pages—When this option is selected, Expression Web 3 will launch the Microsoft Expression Development Server when .aspx files are previewed. If non-ASP.NET pages are previewed, Expression Web 3 will use the path of the site that is open.

For All Web Pages—When this option is selected, Expression Web 3 will use the Microsoft Expression Development Server for all files that are previewed.

Tip

image

Port numbers are used whenever communication takes place over the Internet. By default, web servers use port 80 for HTTP traffic. Other default ports exist for other services.

The Microsoft Expression Development Server chooses a random port in a port range that is not used by common services. This prevents the port the Microsoft Expression Development Server uses from conflicting with something else running on your computer.

Figure 33.2 You configure the use of the Microsoft Expression Development Server through the Site Settings dialog.

image

Figure 33.3 If you attempt to preview an ASP.NET page using a disk path, Expression Web 3 will warn you that you need to use a web server to preview dynamic content.

image

The Microsoft Expression Development Server will remain running for as long as Expression Web 3 is running. However, you can stop it. The following are reasons you might want to manually stop the Microsoft Expression Development Server:

• You have an ASP.NET or PHP page that caches information and want to clear the cache so you can test a particular scenario.

• You are testing code in your application that runs when your application first loads.

Note

image

If the Microsoft Expression Development Server is running when you exit Expression Web 3, it will be stopped automatically.

To manually stop the Microsoft Expression Development Server, right-click the icon in the system tray shown previously in Figure 33.1 and select Stop from the menu. Alternatively, select Show Details from the menu and click the Stop button (see Figure 33.4). Either way, the Microsoft Expression Development Server will stop immediately and will be launched again on a new port the next time it’s needed.

Figure 33.4 You can stop the Microsoft Expression Development Server from the Details dialog box. You also can click the provided link to browse the site in your web browser.

image

Limitations of the Microsoft Expression Development Server

The Microsoft Expression Development Server solves a lot of problems. In addition to providing a solid development platform for ASP.NET and PHP for those using versions of Windows without a web server, it also allows nonadministrators the option of debugging ASP.NET sites locally. However, even with those benefits, it has some limitations.

Note

image

If you are using an IPv6 address, the loopback address will be ::1.

Process Identity

On some occasions in an application, you might need to run code under a specific user’s identity. For example, suppose you have an ASP.NET application that makes heavy use of a Microsoft SQL Server database and you want that database to be accessed via a particular user account. In such a scenario, being able to configure ASP.NET to always run under that particular user account is a valuable feature.

Tip

image

Even though you can’t browse the Microsoft Expression Development Server remotely, you can use the Microsoft Expression Development Server to develop against content that’s located on a different machine. You’ll need to map a drive to the remote content and then start the Microsoft Expression Development Server from a command line using a switch to point it to the content.

For more information on starting the Microsoft Expression Development Server from a command prompt, see “Starting the Microsoft Expression Development Server from the Command Prompt,” p. 586.

The Microsoft Expression Development Server always runs under the user who is logged on to the computer. You cannot configure it to run under a different user account. Therefore, you might not be able to test all scenarios that your application might require.

No Remote Access

The Microsoft Expression Development Server is designed to be browsed from the local machine only. That means you can browse it only using localhost or the TCP/IP loopback address: 127.0.0.1. You cannot browse to the Microsoft Expression Development Server using either your machine name or your computer’s IP address.

Because only localhost and the loopback address are acceptable to the Microsoft Expression Development Server, you also cannot browse an ASP.NET or PHP site running on the Microsoft Expression Development Server from a remote machine. If you need that functionality, you will need to use another web server (such as IIS 7) to develop your application.

Note

image

You might wonder why the Microsoft Expression Development Server doesn’t support ASP pages. There really isn’t any technical reason; it was simply a design choice Microsoft made, most likely because the Microsoft Expression Development Server was first developed as a web server specifically for ASP.NET and PHP development tools.

No Support for ASP Pages

Even though you can configure the Microsoft Expression Development Server to serve all pages, as shown previously in Figure 33.2, it is explicitly designed to not allow ASP pages. If you attempt to browse to an ASP page in the Microsoft Expression Development Server, you’ll get an error telling you that ASP pages are not served (see Figure 33.5).

Figure 33.5 The Microsoft Expression Development Server does not serve ASP pages. Only ASP.NET and HTML pages are supported.

image

Lagniappe (lan yap’) n., a gift or bonus

Starting the Microsoft Expression Development Server from the Command Prompt

In most scenarios, launching the Microsoft Expression Development Server from within Expression Web 3 will suffice. However, if you want to author against remote content via a mapped drive, you’ll need to take a different approach and launch the Microsoft Expression Development Server from a command prompt.

To launch the Microsoft Expression Development Server from a command prompt, navigate to the C:Program FilesMicrosoft ExpressionWeb 3 directory, and then run the following command:

expression.devserver /port:<port> /path:<path>

You’ll need to replace <port> with the port number of your choice and <path> with the path to the mapped drive. For example, to launch the Microsoft Expression Development Server on port 9000 and browse content located at z:website, you would use the following:

expression.devserver /port:9000 /path:z:website

You will then be able to browse your content on the port specified.

Adding on to the preceding example, to browse a page called form.aspx, enter the following into your web browser:

http://localhost:9000/form.aspx

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.61.170