AI OnAI Off
Hi, Mark,
If I understood you correctly, you want to get the page where your blocks reside on (inside a contentarea).
To do that, you can use PageRouteHelper, check out the code bellow:
var pageRouteHelper = ServiceLocator.Current.GetInstance<PageRouteHelper>(); var currentPage = pageRouteHelper.Page;
Then, you can access any property from your current page.
Hope this helps,
Marija
Hi there,
I'm sure this must be easy but I haven't been able to find out how to do it. I have a page with start and end date properties and a content area that can contain mutliple blocks but which must be all of the same type. Each instance of the block on the page needs to use the start and end date properties of the page in order to do some processing. I don't want properties of start and end on each block instance as each block needs to use the same start and end. How do I access the start and end date properties from the page when in the block?
For info this is MVC.
Thanks in advance,
Mark