ASP <asp>
Overview
The <asp> element specifies configuration settings for an ASP application. These include developer-focused configuration settings, such as attributes that control debugging and error return settings. The <asp> element also includes attributes that control the character set used by the application, the script language for the application, and whether error logging is enabled for the application.
The <asp> element can also contain elements that configure COM+, ASP caching, buffering limits, and session state for a site or application.
Compatibility
| Version | Notes |
|---|---|
| IIS 10.0 | The <asp> element was not modified in IIS 10.0. |
| IIS 8.5 | The <asp> element was not modified in IIS 8.5. |
| IIS 8.0 | The <asp> element was not modified in IIS 8.0. |
| IIS 7.5 | The <asp> element was not modified in IIS 7.5. |
| IIS 7.0 | The <asp> element was introduced in IIS 7.0. |
| IIS 6.0 | The <asp> element and its children replace the ASP related properties in the IIS 6.0 IIsWebService object. |
Setup
To support and configure ASP applications on your Web server, you must install the ASP module. To install the ASP module, use the following steps.
Windows Server 2012 or Windows Server 2012 R2
- On the taskbar, click Server Manager.
- In Server Manager, click the Manage menu, and then click Add Roles and Features.
- In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
- On the Server Roles page, expand Web Server (IIS), expand Web Server, expand Application Development, and then select ASP.
.
- If the Add features that are required by ASP? dialog box appears, click Add Features. (This page appears only if you have not already installed the ISAPI Extensions role service on your server.)
- On the Server Roles page, click Next.
- On the Select features page, click Next.
- On the Confirm installation selections page, click Install.
- On the Results page, click Close.
Windows 8 or Windows 8.1
- On the Start screen, move the pointer all the way to the lower left corner, right-click the Start button, and then click Control Panel.
- In Control Panel, click Programs and Features, and then click Turn Windows features on or off.
- Expand Internet Information Services, expand World Wide Web Services, expand Application Development Features, and then select ASP.
Note: The ISAPI Extensions role will be selected if it has not already been installed. - Click OK.
- Click Close.
Windows Server 2008 or Windows Server 2008 R2
- On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
- In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
- In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
- On the Select Role Services page of the Add Role Services Wizard, select ASP.
- If the Add role services required by ASP dialog box appears, click Add Required Role Services. (This page appears only if you have not already installed the ISAPI Extensions role service on your server.)
- On the Select Role Services page, click Next.
- On the Confirm Installation Selections page, click Install.
- On the Results page, click Close.
Windows Vista or Windows 7
- On the taskbar, click Start, and then click Control Panel.
- In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
- Expand Internet Information Services, then World Wide Web Services, then Application Development Features.
- Select ASP, and then click OK.
How To
How to configure ASP settings for a site or application
- Open Internet Information Services (IIS) Manager:
- If you are using Windows Server 2012 or Windows Server 2012 R2:
- On the taskbar, click Server Manager, click Tools, and then click Internet Information Services (IIS) Manager.
- If you are using Windows 8 or Windows 8.1:
- Hold down the Windows key, press the letter X, and then click Control Panel.
- Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
- If you are using Windows Server 2008 or Windows Server 2008 R2:
- On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
- If you are using Windows Vista or Windows 7:
- On the taskbar, click Start, and then click Control Panel.
- Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
- If you are using Windows Server 2012 or Windows Server 2012 R2:
- In the Connections pane, expand the server name, expand Sites, and then navigate to the Web site or Web application that you want to configure.
- In the site or application Home pane, double-click ASP.
- In the ASP pane, configure the required settings, and then click Apply in the Actions pane.
Configuration
You can configure the <asp> element at the server level in the ApplicationHost.config file. However, by default, you cannot configure the <asp> element at the site level or application level.
Attributes
| Attribute | Description |
|---|---|
appAllowClientDebug |
Optional Boolean attribute. |
appAllowDebugging |
Optional Boolean attribute. |
bufferingOn |
Optional Boolean attribute. |
calcLineNumber |
Optional Boolean attribute. |
codePage |
Optional uint attribute. |
enableApplicationRestart |
Optional Boolean attribute. |
enableAspHtmlFallback |
Optional Boolean attribute. |
enableChunkedEncoding |
Optional Boolean attribute. |
enableParentPaths |
Optional Boolean attribute. |
errorsToNTLog |
Optional Boolean attribute. |
exceptionCatchEnable |
Optional Boolean attribute. |
lcid |
Optional uint attribute. |
logErrorRequests |
Optional Boolean attribute. Specifies whether ASP errors are written to the client browser and the IIS logs by default. The default value is |
runOnEndAnonymously |
Optional Boolean attribute. |
scriptErrorMessage |
Optional string attribute. |
scriptErrorSentToBrowser |
Optional Boolean attribute. |
scriptLanguage |
Optional string attribute. |
Child Elements
| Element | Description |
|---|---|
cache |
Optional element. Specifies ASP cache settings. |
comPlus |
Optional element. Specifies COM+ settings. |
limits |
Optional element. Specifies limits for various ASP properties. |
session |
Optional element. Specifies ASP session state settings. |
Configuration Sample
The following configuration example enables buffering and session state for ASP applications on a site named Contoso, and disables parent paths for that same site.
<location path="Contoso">
<system.webServer>
<asp enableParentPaths="false" bufferingOn="true">
<session allowSessionState="true" />
</asp>
</system.webServer>
</location>Sample Code
The following code examples enable buffering and session state for ASP applications on a site named Contoso, and disable parent paths for that same site.
AppCmd.exe
appcmd.exe set config "Contoso" -section:system.webServer/asp /enableParentPaths:"False" /commit:apphost appcmd.exe set config "Contoso" -section:system.webServer/asp /bufferingOn:"True" /commit:apphost appcmd.exe set config "Contoso" -section:system.webServer/asp /session.allowSessionState:"True" /commit:apphost
Note: You must be sure to set the commit parameter to apphost when you use AppCmd.exe to configure these settings. This commits the configuration settings to the appropriate location section in the ApplicationHost.config file.
C#
using System;
using System.Text;
using Microsoft.Web.Administration;
internal static class Sample
{
private static void Main()
{
using (ServerManager serverManager = new ServerManager())
{
Configuration config = serverManager.GetApplicationHostConfiguration();
ConfigurationSection aspSection = config.GetSection("system.webServer/asp", "Contoso");
aspSection["enableParentPaths"] = false;
aspSection["bufferingOn"] = true;
ConfigurationElement sessionElement = aspSection.GetChildElement("session");
sessionElement["allowSessionState"] = true;
serverManager.CommitChanges();
}
}
}
VB.NET
Imports System
Imports System.Text
Imports Microsoft.Web.Administration
Module Sample
Sub Main()
Dim serverManager As ServerManager = New ServerManager
Dim config As Configuration = serverManager.GetApplicationHostConfiguration
Dim aspSection As ConfigurationSection = config.GetSection("system.webServer/asp", "Contoso")
aspSection("enableParentPaths") = False
aspSection("bufferingOn") = True
Dim sessionElement As ConfigurationElement = aspSection.GetChildElement("session")
sessionElement("allowSessionState") = True
serverManager.CommitChanges()
End Sub
End Module
JavaScript
var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";
var aspSection = adminManager.GetAdminSection("system.webServer/asp", "MACHINE/WEBROOT/APPHOST/Contoso");
aspSection.Properties.Item("enableParentPaths").Value = false;
aspSection.Properties.Item("bufferingOn").Value = true;
var sessionElement = aspSection.ChildElements.Item("session");
sessionElement.Properties.Item("allowSessionState").Value = true;
adminManager.CommitChanges();
VBScript
Set adminManager = CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"
Set aspSection = adminManager.GetAdminSection("system.webServer/asp", "MACHINE/WEBROOT/APPHOST/Contoso")
aspSection.Properties.Item("enableParentPaths").Value = False
aspSection.Properties.Item("bufferingOn").Value = True
Set sessionElement = aspSection.ChildElements.Item("session")
sessionElement.Properties.Item("allowSessionState").Value = True
adminManager.CommitChanges()





