After reading this question and its answer: How to set ViewBag properties for all Views without using a base class for Controllers? I have created a custom WebViewPage with an extra property on it:
public abstract class MyWebViewPage<TModel> : WebViewPage<TModel>
{
protected MyObject MyProperty { get; set; }
}
public abstract class MyWebViewPage: MyWebViewPage<dynamic> { }
This has worked well, and the property is now accessible and correctly typed when I use it in any of my views. But now I'd like to automatically assign a value to this property from an ActionFilter, how do I access the instance of "MyWebViewPage" from the filter in order to assign to that property?