Creating and Opening Web Sites


In this section, I cover how to create a new web site and open existing ones with the new version of VS .NET. Also, I show you how to migrate applications created with the older version of the IDE.

Creating a new web site within VS .NET has become quite easy. To do so, you can use the local IIS 5.0, 5.1, or 6.0. Alternatively, storing the web site directly in your local file system and accessing it via FrontPage Server Extensions and even via FTP is possible.

Creating a New Web Site

The New Web Site dialog box (which you access through the File menu) offers all opportunities mentioned previously, as shown in Figure 2-2. When you click the Browse button, the Choose Location dialog box appears (see Figure 2-3), from which you can select the site's storage location. If you choose File System, you can create new directories. If you choose IIS Local, you can define new applications and virtual directories at the local IIS level.

click to expand
Figure 2-2: Creating a new web site is quite simple nowadays.

click to expand
Figure 2-3: In the Choose Location dialog box, you choose among the File System, IIS Local, FTP Sites, or SharePoint Sites options.

VS .NET includes several sample projects. Some of these projects are pretty extensive, and you can use them as starting points for your own web sites or to discover the new features of ASP.NET v2.0:

  • The project template ASP.NET Internet Site provides a web site along with a secured area, including registration and login. It demonstrates the new data source concept in action. The required data is provided by static XML files and by an included Access database. Access also acts as the storage location for user management.

  • The project template ASP.NET Intranet Site is, as its name implies, targeted to intranet applications. The template's main goal is to reveal the possibilities of personalization. The example shows the visual customization of the displayed information based on the authenticated user called Web Parts.

  • The templates ASP.NET Web Site and Empty Web Site are very similar at this point. The first one creates a single page automatically; the second one doesn't.

  • Last but not least, the project template ASP.NET Web Services is used to create a new web services web site. Of course, you can also add web services to any other existing project.

All of the previously described templates are available in C# and Visual Basic .NET (VB .NET) versions. This isn't a big deal, however, because the templates don't require much source code thanks to the new zero-code scenarios. Samples in J# aren't available yet.

Something different from previous approaches is that there's no special project file generated at the time of project creation. From now on, every file within the selected directories belongs to the project automatically. This approach simplifies adding new files, including references to the bin directory, and moving projects. Distributing a complete project is now a job for XCopy. If you work in a team, you'll love this new approach. Besides the project files, VS .NET still offers the old solution files.

Opening an Existing Web Site

Opening a web site is very easy too through VS .NET's Open Web Site dialog box. The Open Web Site dialog box shown in Figure 2-4 is similar to the New Web Site dialog box shown in Figure 2-1. It offers direct access to the file system, the local IIS, an FTP server, and any server offering FrontPage Server Extensions (mentioned as Share-Point Sites in the dialog box). You can also handle projects managed by Visual SourceSafe.

click to expand
Figure 2-4: To open a web site, just point to the corresponding directory in the Open Web Site dialog box.

Migrating an Existing vs .NET 2002/2003 Web Application

Changes in the project management features are among the reasons that you need to migrate VS .NET 2002 and 2003 applications before you use them in the new version. After you confirm your intention to migrate, VS .NET performs the whole conversion without requiring further input from you. All changes are logged in the UpgradeReport.txt file. I didn't encounter any problems during my tests.

Caution

Keep in mind that migration works in one direction only, and the old VS .NET versions can't handle a migrated project. Make sure to create backup before you start the migration process—VS .NET doesn't create one automatically for you!




ASP. NET 2.0 Revealed
ASP.NET 2.0 Revealed
ISBN: 1590593375
EAN: 2147483647
Year: 2005
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net