How to Develop a One-Page Web Application
(Page 1 of 4 )
Before you can build your first ASP.NET application, there are certain skills you need to master. This article, the first of three parts, teaches you how to start, open, and close a website, among other things. It is excerpted from the book
Murach's ASP.NET 2.0 Web Programming with VB2005, written by Doug Lowe (Murach, 2006; ISBN: 1890774324).
How to work with ASP.NET web sites
This chapter starts by showing you how to start a new web application, how to work with the Visual Studio IDE, how to add folders and files to an application, and how to close and re-open an application. Once you’re comfortable with those skills, you’ll be ready to learn how to build your first ASP.NET application.
How to start a new web site
In Visual Studio 2005, a web application is called a web site, and figure 2-1 shows the dialog box for starting a new web site. After you open the New Web Site dialog box, you select the language you want to use for the web site and you specify the location where the web site will be created.
The Location drop-down list gives you three options for specifying the location of the web site. The simplest method is to create a file-system web site. This type of web site can exist in any folder on your local hard disk, or in a folder on a shared network drive. You can run a file-system web site using either Visual Studio’s built-in development server or IIS. You’ll learn how to do that later in this chapter.
You use the HTTP option to create a web site that runs under IIS on your local computer or on a computer that can be accessed over a local area network. To use this option, you must specify the IIS server where you want to create the web site. In addition, you must select or create the IIS directory that will contain the files for the web site, or you must select or create a virtual directory for the web site.
The third option, FTP, lets you create a web site on a remote server by uploading it to that server using FTP. To create this type of web site, you must specify at least the name of the FTP server and the folder where the web site resides. You’ll learn more about how to use the HTTP and FTP options in chapter 4.
By default, Visual Studio 2005 creates a solution file for your web site in My Documents\Visual Studio 2005\Projects. This solution file is stored in this folder regardless of the location of the web site itself. To change the location where solutions are stored by default, choose Tools->Options. Then, expand the Projects and Solutions node, select the General category, and enter the location in the Visual Studio Projects Location text box.
In the dialog box in this example, I’m starting a new file-system web site named Ch02FutureValue in the ASP.NET 2.0 Web Sites folder on my own PC. Then, when I click the OK button, Visual Studio creates the folder named Ch02FutureValue and puts the starting files for the web site in that folder. It also creates a solution file in the default folder for those files.
The folders and files that are used for developing a web site can be referred to as a web project. So in practice, web sites are often referred to as web projects, and vice versa. In a moment, you’ll see that Visual Studio often uses the term project in the commands for working with web sites.
The New Web Site dialog box

Figure 2-1. How to start a new web site
Three location options for ASP.NET web sites
Option | Description |
File System | A web site created in a folder on your local computer or in a shared folder on a network. You can run the web site directly from the built-in development server or create an IIS virtual directory for the folder and run the application under IIS. |
HTTP | A web site created under the control of an IIS web server. The IIS server can be on your local computer or on a computer that’s available over a local area network. |
FTP | A web site created on a remote hosting server. |
Description
- An ASP.NET web application is called a web site under ASP.NET 2.0, so you use the File->New Web Site command to create a new ASP.NET 2.0 web site.
- A web project is a project that’s used for the development of a web site. In practice, web sites are often referred to as web projects, and vice versa.
- Unlike previous versions of ASP.NET, ASP.NET 2.0 web sites don’t use project files. Instead, they use web.config files to store project information.
- When you start a new web site, Visual Studio creates a solution file for the web site in the default location for solution files, which is normally My Documents\Visual Studio 2005\Projects.
Next: How to work with the Visual Studio IDE >>
More ASP.NET Articles
More By Murach Publishing
|
This article is excerpted from the book Murach's ASP.NET 2.0 Web Programming with VB2005, written by Doug Lowe (Murach, 2006; ISBN: 1890774324). Check it out today at your favorite bookstore. Buy this book now.
|
|