Esempio n. 1
0
 public static Route MapRedirectRoute(this AreaRegistrationContext context, string routeUrl, RouteReference redirectRoute, params IRouteConstraint[] constraints)
 {
     return(context.MapRedirectRoute(routeUrl, redirectRoute, null, constraints));
 }
Esempio n. 2
0
        public static Route MapRedirectRoute(this AreaRegistrationContext context, string routeUrl, RouteReference redirectRoute, object routeValues, params IRouteConstraint[] constraints)
        {
            var routeValueDictionary = routeValues == null ? null : new RouteValueDictionary(routeValues);

            var route = new Route(GetMapRouteUrl(routeUrl), new RedirectRouteHandler(redirectRoute, routeValueDictionary, true))
            {
                Constraints = CreateConstraints(false, routeValueDictionary, constraints)
            };

            context.Routes.Add(route);
            return(route);
        }
Esempio n. 3
0
        private static ReadOnlyApplicationUrl GenerateUrl(this RouteReference route, RequestContext requestContext, RouteCollection routeCollection, RouteValueDictionary routeValues)
        {
            var url = UrlHelper.GenerateUrl(route.Name, null, null, routeValues, routeCollection, requestContext, false);

            return(new ReadOnlyApplicationUrl(route.EnsureHttps, RemoveDefaultAspx(url)));
        }
Esempio n. 4
0
 public static ReadOnlyApplicationUrl GenerateUrl(this RouteReference route, RouteValueDictionary routeValues)
 {
     return(route.GenerateUrl(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()), RouteTable.Routes, routeValues));
 }
Esempio n. 5
0
 public AreaRoute(string name, bool?ensureHttps, string url, IRouteHandler routeHandler)
     : base(GetUrl(url), routeHandler)
 {
     _reference = new RouteReference(name, ensureHttps);
 }
Esempio n. 6
0
 public RedirectRouteHandler(RouteReference redirectRoute, RouteValueDictionary routeValues, bool permanently)
 {
     _redirectRoute = redirectRoute;
     _routeValues   = routeValues;
     _permanently   = permanently;
 }