I need to patch in a fix for a bug with Sitecore MVC Caching (confirmed by support).
The pipeline I need to patch into is:
I need to set cache settings on the page object, e.g:
page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
However to do that I need access to the System.Web.UI.Page.
Whatever I try the page is coming up null:
PageContext page = Context.Page;
Page page = HttpContext.Current.Handler as Page;
Page page = Sc.Context.Page.Page;
I know I can use:
Page page = PageContext.CurrentOrNull.Item;
To get the Sitecore page item but I need the System.Web.UI.Page, not the item.
I'm guessing this is due to the order in which the MVC Pipelines run etc: http://jockstothecore.com/sitecore-mvc-item-maze/
Any help would be appreciated.
Other info: Sitecore 8.1 Update 2, MVC