Introducing ASP.NET - Creating an ASP.NET Web Site (Page 4 of 5 ) Dreamweaver uses web site information to keep track of changes to files, updates to hyperlinks in documents, file uploads, and so on. What it does not do is to act as a web server—that is the role of IIS. Dreamweaver Setup Creating an ASP.NET web site is just like creating any other type of site in Dreamweaver. Follow these steps to set up a test site. Go to the Files panel and click Manage Sites, as shown in Figure 3-4. 
Figure 3-4. Starting the Site Definition Wizard in Dreamweaver The Manage Sites dialog box appears. Click the New button and select Site from the small menu. The Site Definition Wizard appears, in which you can specify your web site’s properties.
- If it is not already selected, click the Basic tab and type a name for your web site—we will use testASPNETsite for our example. Select a language, as shown in Figure 3-5.
Figure 3-5. Choosing a technology for the new site
- If you can’t see the .NET language you want, select any one. In ASP.NET it’s just a matter of changing the @ Page directive’s language attribute. We’ll show you how to do that in the next chapter.
- Click Next to define the directory where you want to store your files. Dreamweaver detects the presence of IIS and allows you to use it as the testing server. Dreamweaver’s web site definition is only internal—your pages will not be published on the web by merely existing under a Dreamweaver web site. We show you how to set up IIS in the next section. For now, go through the remaining screens of the wizard and specify where the testing server is located, and use the wizard’s Advanced tab to customize the site creation. When you are done, your new web site should appear in the Files panel. (Ours is shown in Figure 3-6 with one page. You can use the default.aspx page supplied in the download.)
Figure3-6. The newly created site, as listed in the Dreamweaver Files panel
To set up a page as the default for the web site, right-click it and select Set as Home Page from the menu. This will make it the page that appears if no specific page is requested.
Let’s see how a site’s contents can be made available to the web. Internet Information Services Setup To publish your content (to the Internet or an internal network), you will need to enter the server’s IP address in the URL box of your browser. However, if you are just using your local machine as your server, you can enter localhost or 127.0.0.1 instead. You eventually want to see the following result when calling your page—we used an imaginary IP address in Figure 3-7. 
Figure 3-7. The desired result after successfully setting up the web site in IIS
- Open the IIS interface on your Windows server by clicking Start -> Programs -> Administrative Tools -> Internet Services Manager. A web site is created called Default Web Site. This corresponds to any files you place directly in the C:\inetpub\wwwroot directory. If you are hosting only one web site on your server, you might as well use this predefined site. Otherwise, you can add new ones via the New Web Site Creation Wizard. The Web Site Creation Wizard can be started by selecting Action -> New -> Web Site, as shown in Figure 3-8.
Figure 3-8. Starting the Web Site Creation Wizard in IIS
The first screen asks for the web site name, so enter the name you used in Dreamweaver. The next screen asks for your site’s IP address. If you don’t know it, leave it unspecified. You use the Host Header field (shown in Figure 3-9) when you want to host multiple web sites on the same server. The server needs some way of distinguishing which web site each received request is meant for, so it looks up the value of the HTTP Host Header. If you’re hosting only one web site on your server (or if you are using your local machine), leave this field blank. 
Figure 3-9. Specifying the IP address and the domain of your web site
- Specify the physical directory where your web site content is stored, just as you did for Dreamweaver, as shown in Figure 3-10.
Figure 3-10. Specifying the path to your web site’s root
Remember, this can be anywhere on your machine, not just under C:\Inetpub\wwwroot, as long as web sharing is enabled for that folder. Let’s open a bracket here and quickly see how this is done.
- Right-click your folder and click Properties. Select the Web Sharing tab and choose the Share this folder option, as shown in Figure 3-11. Then specify the web site you are sharing it on, if necessary.
Figure 3-11. Configuring any folder for web access
- Back to the IIS wizard, accept the defaults in the screen where web site permissions are set. The remaining features are advanced settings that involve security risks.
- Click Finish to save the web site setup. Next you’ll set your default page. Right-click the newly created web site and click Properties, as shown in Figure 3-12.
Figure 3-12. Additional web site properties
- On the Documents tab, you can add the names of the default documents that will be sent to the client browser if none were specified. Let’s assume that for your ASP.NET web site, the default is a page called default.aspx, so click Add and type that name. Then use the arrows on the left of the page list to move it up in priority (or remove the other entries).
- While the Properties dialog box is open, let’s check to see if the ASPX pages will be handled properly. Click the Home Directory tab and click the Configuration button. This changes application-related settings for this web site. Click the Mappings tab to display a list of all the ISAPIs that are listening for requests to the page types that they handle. If your installation of the .NET Framework was successful, you will see the extension .aspx in that list and the path to the aspnet_isapi.dll library that processes ASP.NET requests. You don’t need to modify anything here, it’s just reassuring that the mapping is actually there!
- Your creation is now viewable to the world! Test your web site by typing the URL and pressing Enter.
http://[your IP address or domain name]/testASPNETsite Your page should look as shown earlier in Figure 3-7. Next: Configuring the ASP.NET Web Site >>
More ASP.NET Articles More By Apress Publishing | This article is excerpted from chapter three of the book ASP.NET Web Development with Macromedia Dreamweaver MX, written by Costas Hadjisotiriou et al. (Apress, 2004; ISBN: 1590593480). Check it out at your favorite bookstore. Buy this book now.
|
| |