Uređivanje

Dijeli putem


Page.RouteData Property

Definition

Gets the RouteData value of the current RequestContext instance.

public:
 property System::Web::Routing::RouteData ^ RouteData { System::Web::Routing::RouteData ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.Routing.RouteData RouteData { get; }
[<System.ComponentModel.Browsable(false)>]
member this.RouteData : System.Web.Routing.RouteData
Public ReadOnly Property RouteData As RouteData

Property Value

The RouteData value of the current RequestContext instance.

Attributes

Remarks

If a page is running in response to a request made through ASP.NET routing, this property provides access to the URL parameter values that were passed as route data. If the page runs in response to a physical URL instead of a route URL, this property is null. The following example shows how to extract the value of a URL parameter that is named year.

Dim year As Integer = Convert.ToInt32(Page.RouteData.Values("year"))
int year = Convert.ToInt32(Page.RouteData.Values["year"])

If the route is defined by using the URL pattern {locale}/{year} for the domain contoso.com, and if the requested URL is contoso.com/US/2010, year will contain the value "2010" when this code runs.

For more information about ASP.NET routing, see ASP.NET Routing.

Applies to

See also