Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Get current page in block's Set Default Values method.


I need to set a block's property on the basis of a page property under which that block is being created.

So, to achieve this, I have overriden SetDefaultValues method in block type. And in this method I tried getting current page from IPageRouteHelper interface using below code.

But it always returns StartPage as the current Page.

How can we get the current Page in the bllock type?


Oct 05, 2017 14:25

I'm not sure that is possible. A block isn't created "under" a page. It is created in a ContentFolder, and after that it can be added to a page (in e.g. a content area). When a block is created there isn't a current page.

Oct 05, 2017 20:50
* 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.