urlMappings 元素(ASP.NET 设置架构)

[本文档仅供预览,在以后的发行版中可能会发生更改。包含的空白主题用作占位符。]

定义一个映射,该映射隐藏实际的 URL 并将其映射到用户更容易记忆的 URL。

<urlMappings enabled="true|false">
    <add.../>
    <clear />
    <remove.../>
</urlMappings>

特性和元素

以下几节描述了特性、子元素和父元素。

特性

特性

说明

enabled

可选的 Boolean 特性。

确定是否启用站点导航功能。

默认值为 true。

子元素

元素

说明

add

可选元素。

将指定的 UrlMapping 对象添加到集合。

clear

可选元素。

从集合中移除所有 UrlMapping 对象。

remove

可选元素。

已重载。 从集合中移除 UrlMapping 对象。

父元素

元素

说明

configuration

公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中均需要的根元素。

system.web

指定配置文件中 ASP.NET 配置设置的根元素。 包含各种配置元素,这些配置元素配置 ASP.NET Web 应用程序并控制这些应用程序的行为方式。

备注

默认配置

下面的默认 urlMappings 元素在 .NET Framework 版本 2.0 的根 Web.config 文件中配置。

<urlMappings enabled="true" />

示例

下面的示例为 ASP.NET 应用程序配置 urlMappings 元素。

<urlMappings enabled="true">
  <clear />
  <add url="~/Home.aspx" mappedUrl="~/Default.aspx?tab=home" />
  <remove url="~/Home2.aspx" />
</urlMappings>

元素信息

配置节处理程序

System.Web.Configuration.UrlMappingsSection

配置成员

SystemWebSectionGroup.UrlMappings

UrlMappingsSection.UrlMappings

可配置的位置

Machine.config

根级别的 Web.config

应用程序级别的 Web.config

要求

IIS 版本 5.0、5.1 和 6.0

.NET Framework 版本 2.0

Visual Studio 2005

请参见

任务

How to: Configure Specific Folders Using Location Settings

How to: Lock ASP.NET Configuration Settings

参考

system.web 元素(ASP.NET 设置架构)

configuration 元素(常规设置架构)

urlMappings 的 add 元素(ASP.NET 设置架构)

urlMappings 的 clear 元素(ASP.NET 设置架构)

urlMappings 的 remove 元素(ASP.NET 设置架构)

System.Configuration

System.Web.Configuration

概念

ASP.NET Configuration Overview

Configuration Inheritance

Securing Configuration

其他资源

常规配置设置 (ASP.NET)

ASP.NET 配置设置

Configuring ASP.NET Applications

ASP.NET Configuration API