Creating an IIS Virtual Directory


ASP.NET handles requests issued to a Web server, which is typically IIS on the Microsoft Windows platform. If you are using Visual Studio to create Web pages, Visual Studio will automatically create a virtual directory for you. When using the .NET Framework without Visual Studio, you will need to create a virtual directory unless you are using the default Web site physical directory.

To set up an IIS virtual directory for ASP.NET, you must first have a directory on disk to be used for the application. Of course, we assume that you also have IIS and the .NET Framework installed. In this example, we’ll use a sample directory created at C:\SampleApplication. To create the IIS virtual directory, perform the following steps:

  1. On Windows 2000, select Programs from the Start menu, and then select Administrative Tools and Internet Services Manager. If you are using Windows XP, select Control Panel from the Start menu. Choose Performance And Maintenance, Administrative Tools, and then Internet Information Services. Alternatively, you can type inetmgr at the prompt you see after selecting Run from the Start menu.

  2. Expand the local computer node followed by the Web Sites node.

  3. Right-click the Default Web Site node. Select New and then Virtual Directory from the expanded menu.

  4. On the first page of the Virtual Directory Creation Wizard, click Next. Then enter the alias for the application, which will be part of the URL path used to access the Web pages of the new application. For example, you would type SampleApplication and the URL to get to the application from that machine: http://localhost/SampleApplication. Click Next to continue.

  5. Enter the physical location where the Web application will exist. In our example, we would use C:\SampleApplication. Click Next to get to the Access Permission page.

  6. Many any necessary changes to the security for the application. See Chapter 9 for detailed information about security considerations. Click Next and then click Finish.

The IIS Virtual Directory now exists, and .ASPX pages that you place in the physical location (C:\SampleApplication) are accessible from the newly created virtual directory at http://MachineName/SampleApplication.




Microsoft ASP. NET Coding Strategies with the Microsoft ASP. NET Team
Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team (Pro-Developer)
ISBN: 073561900X
EAN: 2147483647
Year: 2005
Pages: 144

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