Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

RouteCollectionExtensions.MapRoute Method (RouteCollection, String, String, String[])

Maps the specified URL route.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
public static Route MapRoute(
	this RouteCollection routes,
	string name,
	string url,
	string[] namespaces
)

Parameters

routes
Type: System.Web.Routing.RouteCollection
The routes.
name
Type: System.String
The name.
url
Type: System.String
The URL.
namespaces
Type: System.String[]
The namespaces.

Return Value

Type: System.Web.Routing.Route
A reference to the mapped route.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type RouteCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
ExceptionCondition
ArgumentNullException

The routes or url parameter is null.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.