ASP.NET
  Home arrow ASP.NET arrow Page 3 - Setting Up Internet Information Services a...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Setting Up Internet Information Services and ASP.NET
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2005-11-10

    Table of Contents:
  • Setting Up Internet Information Services and ASP.NET
  • Managing Websites
  • Virtual Directories and Web Applications
  • Custom Errors
  • Installing ASP.NET

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Setting Up Internet Information Services and ASP.NET - Virtual Directories and Web Applications


    (Page 3 of 5 )

     

    You can manage all the virtual directories on your computer in the Internet Information Service utility by expanding the tree under the Default Website item. You’ll notice that items in the tree have three different types of icons, as shown in Figure 2-8.


    Figure 2-8.  Web folders

    Different icons have different meanings:

    • Ordinary folder. This represents a subdirectory inside another virtual directory. For example, if you create a virtual directory and then add a subdirectory to the physical directory, it will be displayed here.
    • Folders with a globe. This represents a virtual directory.

    • Package folders. This represents a virtual directory that is also a web application. By default, when you use the wizard to create a virtual directory, it’s also configured as a web application. This means that it will share a common set of resources and run in its own separate application domain. The topic of web applications is examined in more detail in Chapter 5.

      When you create a virtual directory with the Virtual Directory Creation wizard, it’s also configured as a web application. This is almost always what you want. If your virtual directory isn’t a web application, you won’t be able to control its ASP.NET configuration settings, and you won’t be able to create a web application in it using Visual Studio .NET.

    ...........................................................................................................................

    Virtual Directories Allow Access to Subdirectories

    Imagine you create a virtual directory called MyApp on a computer called MyServer. The virtual directory corresponds to the physical directory c:\MyApp. If you add the subdirectory c:\MyApp\MoreFiles, this directory will automatically be included in the IIS tree as an ordinary folder. Clients will be able to access files in this folder by specifying the folder name, as in http://MyServer/MyApp/MoreFiles/SomeFile.html.

    By default, the subdirectory will inherit all the permissions of the virtual directory. However, you can change these settings using the Internet Information Services utility. This is a common technique used to break a single application into different parts (for example, if some pages require heightened security settings).

    ...............................................................................................................................

    Folder Settings

    IIS makes it easy to configure virtual directories after you’ve created them. Simply right-click the virtual directory in the list and choose Properties. The Properties window will appear, as shown in Figure 2-9, with its information divided into several tabs.


    Figure 2-9.  Web directory properties

    The Virtual Directory tab contains the most important settings. These include options that allow you to change the permissions you set when creating the virtual directory with the wizard. You can also see the local path that corresponds to this virtual directory. If you’re looking at the root of a virtual directory, you can set the local path to point to a different physical directory by clicking the Browse button. If you’re looking at an ordinary subdirectory inside a virtual directory, the local path will be read-only.

    Remember, when you create a virtual directory with the wizard, it’s also configured as a web application. You can change this by clicking the Remove button next to the application name. Similarly, you can click the Create button to transform an ordinary virtual directory into a full-fledged application. Usually you won’t need to perform these tasks, but it’s nice to know they are available if you need to make a change. They can come in useful when transplanting an application from one computer to another (as discussed in Chapter 12).

    Any changes that you make will be automatically applied to all subdirectories. If you want to make a change that will affect all the virtual directories on your server, right-click the Default Website item and choose Properties. The change will be cascaded down to all the contained virtual directories. If your change conflicts with the custom settings that you have set for a virtual directory, IIS will warn you. It will present a list of the directories that will be affected and give you the chance to specify exactly which ones you want to change and which ones you want to leave as is (as shown in Figure 2-10).


    Figure 2-10.  A change that affects several directories

    If you explore the directory properties, you’ll discover several other settings that affect ASP applications but don’t have any effect on ASP.NET websites. These include the Application Protection (memory isolation) setting, and the options for session state, script timeout, and default language. These settings are all replaced by ASP.NET’s new configuration file system, which you’ll learn about in Chapter 5. Some other settings are designed for security, and these are examined in Chapter 25.


    TIP  
    Remember, IIS permissions are set on a directory-by-directory basis, which means that all the files in a directory need to share the same set of IIS permissions. As a consequence, the easiest way to apply different settings to different files is to create a virtual directory with more than one subdirectory, and set different options for each subdirectory.

    The next two sections briefly explain two other types of IIS configuration: custom error pages and file mappings.

    Documents

    This tab allows you to specify the default documents for a virtual directory. For example, consider the virtual directory http://localhost/MySite. A user can request a specific page in this directory using a URL like http://localhost/MySite/MyPage1.aspx. But what happens if the user simply types http://localhost/MySite into a web browser?

    In this case, IIS will examine the list of default documents defined for that virtual directory. It will scan the list from top to bottom, and return the first matching page. Using the list in Figure 2-11, IIS will check first for a Default.htm file, then for Default.asp, index.htm, iisstart.asp, and Default.aspx. If none of these pages are found, IIS will return the HTTP 404 (page not found) error.


    Figure 2-11.  The default document list

    You can configure the default document list by removing entries or adding new ones. Most ASP.NET applications simply use Default.aspx as their homepage.

    More ASP.NET Articles
    More By Apress Publishing


       · This article is an excerpt from the book "The Definitive Guide to SAMBA 3",...
     

    Buy this book now. This article is excerpted from chapter two of the book The Definitive Guide to SAMBA 3, written by Roderick Smith (Apress, 2004; ISBN: 1590592778). Check it out at your favorite bookstore today. Buy this book now.

    ASP.NET ARTICLES

    - More Advanced ASP.NET 3.5 Functions and Subr...
    - ASP.NET 3.5 Functions and Subroutines
    - Coding an IQ Test with Conditionally Driven ...
    - Developing Conditionally Driven Event Handle...
    - ASP.NET 3.5 Debugging Using Visual Web Devel...
    - Understanding Event Handlers in ASP.NET 3.5
    - Building a Web Form in ASP.NET and PHP: a Co...
    - Inserting Data into a Microsoft SQL 2008 Dat...
    - Creating an ASP.NET Dynamic Web Page Using M...
    - Retrieving Data from Microsoft SQL Server 20...
    - Building ASP.NET Web Forms to Use a MySQL Da...
    - Creating an ASP.NET Database using MS SQL 20...
    - Building an ASP.NET Website Using Include Ta...
    - Create ASP.NET Web Forms to Use a Microsoft ...
    - Editing Web Design Layout in Visual Web Deve...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek