Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
General Reference
ASP.NET Reference
<system.web>
<urlMappings>
 <add>
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework General Reference
add Element for urlMappings (ASP.NET Settings Schema)

Adds the specified UrlMapping object to the collection.

<add url="String" 
     mappedUrl="String"/>

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

url

Required String attribute.

Defines the application-relative url of incoming requests that will be re-mapped to a different url by the ASP.NET runtime.

mappedURL

Required String attribute.

Defines the application-relative url that is the target of a mapping.

NoteNote

The mappedUrl must be an application-relative Url. At runtime the mappedUrl is converted to an absolute virtual path based on the root of the currently executing application.

The mappedUrl can include query string information.

The mappedUrl is trimmed to eliminate any leading or trailing spaces.

Child Elements

None.

Parent Elements

Element Description

configuration

The required root element in every configuration file used by the common language runtime and .NET Framework applications.

system.web

Specifies the root element for the ASP.NET configuration settings in a configuration file. Contains configuration elements that configure ASP.NET Web applications and control how the applications behave.

urlMappings

Defines the mapping of one url to another mapped url.

The following example adds a UrlMapping object to an ASP.NET application.

NoteNote

By design, you cannot map to the same page. If you do, state information is lost in postbacks.

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

Configuration Section Handler

System.Web.Configuration.UrlMappingsSection

Configuration Member

System.Web.Configuration.SystemWebSectionGroup.UrlMappings

System.Web.Configuration.UrlMappingsSection.UrlMappings

Configurable Locations

Machine.config

Root level Web.config

Application level Web.config

Requirements

IIS version 5.0, IIS version 5.1, or IIS version 6.0

.NET Framework version 2.0

Visual Studio 2005

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker