Exemplo n.º 1
0
        private ActionResult ClientRedirectToAction(string action, string controller = null)
        {
            var url = UrlHelper.GenerateUrl(null, action, controller, this.ControllerContext.RouteData.Values, RouteTable.Routes,
                                            this.Request.RequestContext, true);

            url = UrlHelperExtension.Deprefix(url);
            return(RcJson(RichClientJsonResult.Command_Redirect, url));
        }
Exemplo n.º 2
0
        public ActionResult ClientReloadApp(string action, string controller = null, string qs = null, string state = null)
        {
            var url = UrlHelper.GenerateUrl(null, action, controller, this.ControllerContext.RouteData.Values, RouteTable.Routes,
                                            this.Request.RequestContext, true);

            if (!String.IsNullOrEmpty(qs))
            {
                url = url + "?" + qs;
            }
            if (!String.IsNullOrEmpty(state))
            {
                state = UrlHelper.GenerateUrl(null, state, controller, this.ControllerContext.RouteData.Values,
                                              RouteTable.Routes,
                                              this.Request.RequestContext, true);
                state = UrlHelperExtension.Deprefix(state);
            }
            if (!String.IsNullOrEmpty(state))
            {
                url = url + "#" + state;
            }
            return(RcJson(RichClientJsonResult.Command_AppPage, url));
        }
Exemplo n.º 3
0
        public static void InitRoute()
        {
            DashboardRoutes.Routes.Add("/jsex/domainJob", new EmbeddedResourceDispatcher(Assembly.GetExecutingAssembly(), "Hangfire.JobDomains.Dashboard.Content.domainJob.js"));
            DashboardRoutes.Routes.Add("/cssex/jobdomain", new EmbeddedResourceDispatcher(Assembly.GetExecutingAssembly(), "Hangfire.JobDomains.Dashboard.Content.JobDomains.css"));
            DashboardRoutes.Routes.Add("/image/loading.gif", new EmbeddedResourceDispatcher(Assembly.GetExecutingAssembly(), "Hangfire.JobDomains.Dashboard.Content.image.loading.gif"));

            DashboardRoutes.Routes.AddRazorPage(UrlHelperExtension.MainPageRoute, x => new MainPage());
            DashboardRoutes.Routes.AddRazorPage(UrlHelperExtension.SystemPageRoute, x => new SystemPage());
            DashboardRoutes.Routes.AddRazorPage(UrlHelperExtension.BatchSchedulePageRoute, x => new BatchSchedulePage());
            DashboardRoutes.Routes.AddRazorPage(UrlHelperExtension.DomainPageRoute, x => UrlHelperExtension.CreateDomainPage(x));
            DashboardRoutes.Routes.AddRazorPage(UrlHelperExtension.AssemblyPageRoute, x => UrlHelperExtension.CreateAssemblyPage(x));
            DashboardRoutes.Routes.AddRazorPage(UrlHelperExtension.JobPageRoute, x => UrlHelperExtension.CreateJobPage(x));
            DashboardRoutes.Routes.Add(UrlHelperExtension.JobCommandRoute, new JobCommandDispatcher());

            NavigationMenu.Items.Add(page => new MenuItem(MainPage.Title, page.Url.To(UrlHelperExtension.MainPageRoute))
            {
                Active = page.RequestPath.StartsWith(UrlHelperExtension.MainPageRoute)
            });
        }
        private string GetUrl(ControllerContext controllerContext)
        {
            RouteValueDictionary routeValueDictionary = new RouteValueDictionary();

            routeValueDictionary["controller"] = controllerContext.RouteData.GetRequiredString("controller");
            routeValueDictionary["action"]     = this.Action;
            return(RouteCollectionExtensions.GetVirtualPathForArea(RouteTable.Routes, controllerContext.RequestContext, UrlHelperExtension.GetAdminRouteName(), routeValueDictionary).VirtualPath);
        }