When you start Visual Web Developer, you will typically want to do one of two things: either create a new website or open an existing website. A website is a collection of resources: static and dynamic web pages, graphic files, style sheets, configuration files, and so on. In addition to various files, a website may contain subdirectories, each of which may contain its own set of files and further subdirectories. A website is akin to a folder on your personal computer: It's a repository for files and subfolders. To create a new website with Visual Web Developer, go to the File menu and select New Web Site or simply click the New Web Site icon in the Toolbar. Either of these actions will bring up the New Web Site dialog box, shown in Figure 3.1. Figure 3.1. Create a new website from the New Web Site dialog box.Choosing a Website TemplateWhen creating a new website, you can choose among a number of available templates. For example, there's the ASP.NET Web Site template, the ASP.NET Web Service template, the Personal Web Site Starter Kit template, and an Empty Web Site template. Regardless of what template is selected, a website will be created; the differences among the templates is what default files the template includes with the website. For example, in the preceding hour we saw that creating a new website using the ASP.NET Web Site template creates a website with an App_Data folder and three files: Default.aspx, Default.aspx.vb, and web.config. Creating a website using the Empty Web Site template will create the website but will not add any default folders or files.
Although there is an array of website templates to choose from, all of the examples in this book will be created using the ASP.NET Web Site template. Specifying the Website's LocationWebsites can be located either on your personal computer or on a remote computer. Typically, personal computers do not double as web servers; that is, chances are the personal computer on which you're working right now does not host websites. Rather, you use your PC for your own endssurfing the web, checking email, playing games, and so on. Publicly available websites are often hosted through web-hosting companies, which offer always-on computers with a persistent connection to the Internet. These computers' sole purpose is to host a website; they have web server software running on them and essentially sit around and wait for incoming requests. Upon receiving a request for a web page, they render the page and return the resulting markup to the requesting browser. Often developers place a website on their own personal computer during the building and testing phases. The site won't be accessible over the Internet, but that's okay because the site is not yet ready for the public. When a functional site is complete, though, it can be moved to a remote web-hosting company so that the site can be accessed by anyone with an Internet connection. However, you can opt to create a new site on a remote computer from the get-go. All you need is an account with a web-hosting company.
If you opt to host the website on your local computer you can host it in, potentially, one of two ways:
If you want to host the site locally, from the Location drop-down list, select File System. Next, click the Browse button to the right of the Location drop-down list. This will bring up the Choose Location dialog box shown in Figure 3.2. Figure 3.2. Choose the location where your website will reside.The left column in the Choose Location dialog box lists the various locations the website can be saved.
To host the website on a remote computer, select either the HTTP or FTP options for location and specify the HTTP or FTP address. For the FTP settings, you'll need to provide the FTP server, port, directory, and username/password, if anonymous access is not allowed. Similarly, if you choose to use the HTTP setting when attempting to create the website, you'll be prompted for a username and password. Contact your web-hosting company for information on whether you should use HTTP or FTP access and what settings you'll need to use in order to connect. All of the websites throughout this book will be created on the local file system. Choosing the Source Code Programming LanguageThe setting chosen in the Language drop-down list specifies the programming language of your ASP.NET web pages' source code portions. Two options are available: Visual Basic and Visual C#. As discussed in the preceding hour, the Visual Basic language will be used for the examples throughout this book.
To gain practice creating websites in Visual Web Developer, go ahead and create a new website using the ASP.NET Web Site template, the File System location with the website in a directory of your choice, and with the Language set to Visual Basic. As we saw in the preceding hour, this will create a website with an App_Data folder, a Default.aspx ASP.NET page (with a corresponding Default.aspx.vb file), and a configuration file, web.config. These files are listed in the Solution Explorer, which you can find in the upper-right corner. (If you do not see the Solution Explorer, go to the View menu and choose the Solution Explorer option.) |