Export (0) Print
Expand All

RouteTable::Routes Property

Gets a collection of objects that derive from the RouteBase class.

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

public:
static property RouteCollection^ Routes {
	RouteCollection^ get ();
}

Property Value

Type: System.Web.Routing::RouteCollection
An object that contains all the routes in the collection.

Routes are URL patterns that are used for processing requests and that can be used to construct URLs dynamically. The Routes property is a static property (Shared in Visual Basic) that represents all the objects that are used to specify how a URL request is matched to a class that handles the request. To specify a route, you add the route definition to the Routes property. Typically, you add routes to the Routes property from an event handler for the Application_Start event in the Global.asax file.

When an ASP.NET application handles a request, the application iterates through the collection of routes in the Routes property to find the route that matches the format of the URL request. The order of the routes that you add to the Routes property is significant, because the application uses the first route in the collection that matches the URL.

The following example shows how to add a Route object to the Routes property.

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

.NET Framework

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, 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.

Community Additions

ADD
Show:
© 2014 Microsoft