示例#1
0
 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));
 }
示例#3
0
 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);
     }
 }