This documentation is archived and is not being maintained.
UrlMapping Constructor
Visual Studio 2010
Initializes a new instance of the UrlMapping class.
Assembly: System.Web (in System.Web.dll)
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 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.
<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>
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: