Try our conversational search powered by Generative AI!

CurrentPage In ContentChannel

Vote:
 

Is there a way to get the current page in the | public override bool IsActive(HttpContextBase context) method.  When i try to see if the querystring for the page id is there, it is null, and tried using the routehandler and i can't find the page in there as well.  Am I trying to do the impossible.  I am using web forms so i am not sure the best route to persue here.

#70681
Apr 26, 2013 4:03
Vote:
 

There is a class PageRouteHelper (or the related ContentRouteHelper that also works for content other than pages) that you can get from IOC container (it is HttpContext scoped). Those classes exposes the current routed page/content.

If the request that is excuting has been routed to a specific content/page you would get it throuh the helper. In edit mode not all requests have "current" page set, that is for example for REST request from client edit UI.

#70687
Edited, Apr 26, 2013 9:19
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.