protected virtual void SetPathOverride(ActionExecutingContext filterContext) { if (content == null && ControllerContext != null && ControllerContext.IsChildAction && ControllerContext.ParentActionViewContext != null && ControllerContext.ParentActionViewContext.RouteData.DataTokens.ContainsKey(PathOverrideKey)) { // bypass normal retrieval to handle rendering of auto-generated parts wihtout ID var path = ControllerContext.ParentActionViewContext.RouteData.DataTokens[PathOverrideKey] as PathData; if (path != null) { content = new ControllerContentHelper(() => RouteExtensions.GetEngine(RouteData), () => path); } } }
public MyCustomRedirectController(ILinkGenerator linkGenerator) : base(linkGenerator, null) { Content = new ControllerContentHelper(null, () => new PathData(MyCurrentPage, MyCurrentItem)); }
protected virtual void SetPathOverride(ActionExecutingContext filterContext) { if (content == null && ControllerContext != null && ControllerContext.IsChildAction && ControllerContext.ParentActionViewContext != null && ControllerContext.ParentActionViewContext.RouteData.DataTokens.ContainsKey(PathOverrideKey)) { // bypass normal retrieval to handle rendering of auto-generated parts wihtout ID var path = ControllerContext.ParentActionViewContext.RouteData.DataTokens[PathOverrideKey] as PathData; if (path != null) content = new ControllerContentHelper(() => RouteExtensions.GetEngine(RouteData), () => path); } }