MvcContrib.Routing.RegexRoute.GetRouteData C# (CSharp) Method

GetRouteData() public method

Gets the route data from an incoming request; parses the incoming virtual path and returns the route data that was inside the url.
public GetRouteData ( System.Web.HttpContextBase httpContext ) : System.Web.Routing.RouteData
httpContext System.Web.HttpContextBase The HTTP context containing the url data.
return System.Web.Routing.RouteData
        public override RouteData GetRouteData(HttpContextBase httpContext)
        {
            string requestUrl = httpContext.Request.AppRelativeCurrentExecutionFilePath.Substring(2) + httpContext.Request.PathInfo;
            return GetRouteData(requestUrl);
        }

Same methods

RegexRoute::GetRouteData ( string request ) : System.Web.Routing.RouteData

Usage Example

Exemplo n.º 1
0
		public void ShouldNotBeNullIfRouteIsMatched()
		{
			var route = new RegexRoute("asdf", handler);
			RouteData routeData = route.GetRouteData("asdf");
			Assert.AreSame(handler, routeData.RouteHandler);
			Assert.IsNotNull(routeData, "routeData should not be null if the path matched the regex");
		}
All Usage Examples Of MvcContrib.Routing.RegexRoute::GetRouteData