Class MergeParentContextViewDataAttribute
This attribute can be used for when child actions execute and will automatically merge in the viewdata from the parent context to the child action result.
Inheritance
Namespace: Umbraco.Web.Mvc
Assembly: Umbraco.Web.dll
Syntax
public class MergeParentContextViewDataAttribute : ActionFilterAttribute
Remarks
This will retain any custom viewdata put into the child viewdata if the same key persists in the parent context's view data. You can always still access the parent's view data normally. This just simplifies working with ChildActions and view data.
NOTE: This does not mean that the parent context's view data will be merged before the action executes, if you need access to the parent context's view data during controller execution you can access it normally.
NOTE: This recursively merges in all ParentActionViewContext ancestry in case there's child actions inside of child actions.
Methods
View SourceOnResultExecuting(ResultExecutingContext)
Merge in the parent context's view data if this is a child action when the result is being executed
Declaration
public override void OnResultExecuting(ResultExecutingContext filterContext)
Parameters
Type | Name | Description |
---|---|---|
ResultExecutingContext | filterContext |