This documentation is archived and is not being maintained.

UrlMapping Constructor

Initializes a new instance of the UrlMapping class.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public:
UrlMapping(
	String^ url, 
	String^ mappedUrl
)

Parameters

url
Type: System::String
The URL to be displayed to the user.
mappedUrl
Type: System::String
A URL that exists in your Web application.

The UrlMapping constructor is intended primarily for internal use by ASP.NET. You do not need to derive from this class, and because it can be used to modify the Web.config file, you will probably never need to use it in code.

The following example uses the UrlMappingsSection of the Web.config file to map two URLs, and adds a mapping for an additional URL. When you modify and save the Web.config file, your application restarts.

No code example is currently available or this language may not be supported.

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <appSettings />
  <connectionStrings />

  <system.web>
    <compilation debug="true" />
    <customErrors mode="Off" />

    <authentication />
    <authorization>
      <deny users="?" />
    </authorization>
    <identity impersonate="true" />

    <urlMappings enabled="true">
      <add url="~/home.aspx" mappedUrl="~/default.aspx?show=1" />
      <add url="~/products.aspx" mappedUrl="~/default.aspx?show=2" />
    </urlMappings>
  </system.web>
</configuration>


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: