RouteCollectionExtensions.MapRoute Method
Maps the route.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | MapRoute(RouteCollection, String, String) | Maps the specified URL route. |
![]() ![]() | MapRoute(RouteCollection, String, String, Object) | Maps the specified URL route and sets default route values. |
![]() ![]() | MapRoute(RouteCollection, String, String, Object, Object) | Maps the specified URL route and sets default route values and constraints. |
![]() ![]() | MapRoute(RouteCollection, String, String, Object, Object, String()) | Maps the specified URL route and sets default route values, constraints, and namespaces. |
![]() ![]() | MapRoute(RouteCollection, String, String, Object, String()) | Maps the specified URL route and sets default route values and namespaces. |
![]() ![]() | MapRoute(RouteCollection, String, String, String()) | Maps the specified URL route and sets the namespaces. |
RouteCollectionExtensions.MapRoute Method (RouteCollection, String, String)
Maps the specified URL route.
<ExtensionAttribute> Public Shared Function MapRoute ( routes As RouteCollection, name As String, url As String ) As Route
Parameters
- routes
-
Type:
System.Web.Routing.RouteCollection
A collection of routes for the application.
- name
-
Type:
System.String
The name of the route to map.
- url
-
Type:
System.String
The URL pattern for the route.
| Exception | Condition |
|---|---|
| ArgumentNullException | The routes or url parameter is null. |
RouteCollectionExtensions.MapRoute Method (RouteCollection, String, String, Object)
Maps the specified URL route and sets default route values.
<ExtensionAttribute> Public Shared Function MapRoute ( routes As RouteCollection, name As String, url As String, defaults As Object ) As Route
Parameters
- routes
-
Type:
System.Web.Routing.RouteCollection
A collection of routes for the application.
- name
-
Type:
System.String
The name of the route to map.
- url
-
Type:
System.String
The URL pattern for the route.
- defaults
-
Type:
System.Object
An object that contains default route values.
| Exception | Condition |
|---|---|
| ArgumentNullException | The routes or url parameter is null. |
RouteCollectionExtensions.MapRoute Method (RouteCollection, String, String, Object, Object)
Maps the specified URL route and sets default route values and constraints.
<ExtensionAttribute> Public Shared Function MapRoute ( routes As RouteCollection, name As String, url As String, defaults As Object, constraints As Object ) As Route
Parameters
- routes
-
Type:
System.Web.Routing.RouteCollection
A collection of routes for the application.
- name
-
Type:
System.String
The name of the route to map.
- url
-
Type:
System.String
The URL pattern for the route.
- defaults
-
Type:
System.Object
An object that contains default route values.
- constraints
-
Type:
System.Object
A set of expressions that specify values for the url parameter.
| Exception | Condition |
|---|---|
| ArgumentNullException | The routes or url parameter is null. |
RouteCollectionExtensions.MapRoute Method (RouteCollection, String, String, Object, Object, String())
Maps the specified URL route and sets default route values, constraints, and namespaces.
<ExtensionAttribute> Public Shared Function MapRoute ( routes As RouteCollection, name As String, url As String, defaults As Object, constraints As Object, namespaces As String() ) As Route
Parameters
- routes
-
Type:
System.Web.Routing.RouteCollection
A collection of routes for the application.
- name
-
Type:
System.String
The name of the route to map.
- url
-
Type:
System.String
The URL pattern for the route.
- defaults
-
Type:
System.Object
An object that contains default route values.
- constraints
-
Type:
System.Object
A set of expressions that specify values for the url parameter.
- namespaces
-
Type:
System.String()
A set of namespaces for the application.
| Exception | Condition |
|---|---|
| ArgumentNullException | The routes or url parameter is null. |
RouteCollectionExtensions.MapRoute Method (RouteCollection, String, String, Object, String())
Maps the specified URL route and sets default route values and namespaces.
<ExtensionAttribute> Public Shared Function MapRoute ( routes As RouteCollection, name As String, url As String, defaults As Object, namespaces As String() ) As Route
Parameters
- routes
-
Type:
System.Web.Routing.RouteCollection
A collection of routes for the application.
- name
-
Type:
System.String
The name of the route to map.
- url
-
Type:
System.String
The URL pattern for the route.
- defaults
-
Type:
System.Object
An object that contains default route values.
- namespaces
-
Type:
System.String()
A set of namespaces for the application.
| Exception | Condition |
|---|---|
| ArgumentNullException | The routes or url parameter is null. |
RouteCollectionExtensions.MapRoute Method (RouteCollection, String, String, String())
Maps the specified URL route and sets the namespaces.
<ExtensionAttribute> Public Shared Function MapRoute ( routes As RouteCollection, name As String, url As String, namespaces As String() ) As Route
Parameters
- routes
-
Type:
System.Web.Routing.RouteCollection
A collection of routes for the application.
- name
-
Type:
System.String
The name of the route to map.
- url
-
Type:
System.String
The URL pattern for the route.
- namespaces
-
Type:
System.String()
A set of namespaces for the application.
| Exception | Condition |
|---|---|
| ArgumentNullException | The routes or url parameter is null. |

