Page view counter

These tutorials demonstrate selected features in ASP.NET version 2.0, but they are compatible with later versions of ASP.NET as well. For the current documentation, see the ASP.NET portal on the MSDN Web site.

 

 

   Welcome   |   ASP.NET   |   Web Services   |   Class Browser   
  |   I want my samples in...      

ASP.NET Quickstart Tutorials

Using Management Tools

ASP.NET 2.0 includes a full range of management tools that you can use to configure your web application:
  • An ASP.NET Microsoft Management Console Snapin that integrates with the Internet Information Services (IIS) MMC administration tool, allowing you to change the ASP.NET version of any IIS application, and inspect and change many common settings of ASP.NET 2.0 applications.

  • A Web Application Administration Tool integrated with all versions of Visual Studio, allowing you to configure application configuration such as authentication and authorization settings.

  • Command line tools such as aspnet_regsql, which allows you to configure your SQL database for use with ASP.NET, and aspnet_regiis, which allows you to configure common ASP.NET settings from the command line,

ASP.NET MMC Snapin

The ASP.NET MMC Snapin is integrated into the IIS MMC administration tool. To use the snapin, use the following steps:
  1. Open the IIS MMC console, by using Administrative Tools/Internet Information Services.

  2. Select the application or directory you want to configure, and select Properties from the Action menu.

  3. From the property sheet, click on the ASP.NET tab.

  4. On this tab, you can review or change the ASP.NET version used for the current application. Any change you make to this setting applies to all child applications.

    ASP.NET tab

  5. To make changes to configuration settings at this level, click on Edit configuration. A separate window will open, allowing you to inspect or change settings. Click OK to apply settings and close the window.

    Edit configuration dialog

Web Application Administration Tool

One of the new features for web developers in Visual Studio 2005 is a graphical administration tool for configuring common application and security settings for your web sites. The Web Application Administration tool allows you to perform the following configuration tasks:
  • Configure application security, including authentication and authorization settings
  • Manage users and roles for your application
  • Create or manage application settings
  • Configure SMTP e-mail settings
  • Take an application temporarily offline, to allow reliable updates of content and data
  • Adjust debugging and tracing settings
  • Define a default custom error page
  • Select providers for use with site features such as membership

The Web Application Administration tool is available with all versions of Visual Studio 2005, and from Visual Studio 2005 Express Edition. To open the administration tool from a web site project, select ASP.NET Configuration from the Website menu.

Web administration tool

The ASPNET_REGSQL Tool

ASP.NET 2.0 has a number of application services that can be configured to use a SQL Server database, including session state, membership, role manager, profiles, personalization, SQL web event provider, and SQL cache invalidation.

Each of these features require that ASP.NET and the database be configured to set up permissions, and create and prepopulate databases as needed. To configure and install databases on a SQL server to use these ASP.NET features, you can use the aspnet_regsql tool. This tool can be found in the version-specific framework directory, under the Microsoft.NET\Framework subdirectory of your Windows system folder.

The aspnet_regsql tool can be used either as a command line tool or a wizard. To run the tool as a wizard, you can run it without any command line arguments. To see a list of available options, run aspnet_regsql -?.

The ASPNET_REGIIS Tool

The .NET Framework redistributable includes a command line tool, called aspnet_regiis, for installing and uninstalling ASP.NET and features on sites. You can also use this tool to manage configuration encryption features.

Each version of the .NET Framework includes an ASPNET_REGIIS tool. To configure a particular version of ASP.NET, you need to locate and use the corresponding version of ASPNET_REGIIS. The tool can be found in the version-specific framework directory, under the Microsoft.NET\Framework subdirectory of your Windows system folder.

The following are some examples of ASPNET_REGIIS command line syntax. For a list of all options, enter aspnet_regiis -?.

Install ASP.NET
To install a version ASP.NET on a machine, and map all applications to use it, use aspnet_regiis -i.
To install without updating all applications to use ASP.NET 2.0, use aspnet_regiis -ir.

Enable ASP.NET in the IIS 6.0 Security Console
To enable ASP.NET as a valid extension for IIS 6.0, use aspnet_regiis -i -enable or aspnet_regiis -ir -enable, depending on whether you want to map all existing applications to ASP.NET 2.0.
To disable it, use aspnet_regiis -i -disable or aspnet_regiis -ir -disable.

Uninstall ASP.NET
To uninstall a version of ASP.NET, run aspnet_regiis -u. All existing applications using this version will be remapped to the highest remaining version of ASP.NET.
To uninstall all versions, use aspnet_regiis -ua.

Map an IIS application to an ASP.NET version
To configure an IIS application to run a specific version of ASP.NET, call aspnet_regiis -s path or aspnet_regiis -sn path. path should be the IIS metabase path of the application, and is usually in the form w3svc/site id/root/path from root to application. For example, the directory MyDir on the default web site has an IIS path of w3svc/1/root/MyDir. Note: Using -s will recursively map all child applications to the same version.

List versions of ASP.NET
To list all installed versions of ASP.NET on a computer, use aspnet_regiis -lv.
To install specific mappings for individual directories, use aspnet_regiis -lk.

Give a user permissions to access ASP.NET resources
To give a specific Windows user account permissions to the IIS metabase, and to special directories used by ASP.NET, use aspnet_regiis -ga user, where user the user name. This option is helpful when configuring ASP.NET to run under a different user identity.