CMSPage.OnBeforePageInit event is not getting called

joyanta sen asked on August 9, 2018 01:23

Hi, Could anyone please tell me why CMSPage.OnBeforePageInit event is not getting called for non-admin pages? It is getting called only for admin pages.

Thanks.

Correct Answer

Michal Samuhel answered on August 9, 2018 08:13

Hi,

It is because CMSPage is used only for administration pages:

"Base page for all CMS administration UI pages"

and it is not part of public pages.

0 votesVote for this answer Unmark Correct answer

Recent Answers


joyanta sen answered on August 9, 2018 19:09

HI, Ok, so is there any event which will be called during public page load?

Thanks.

0 votesVote for this answer Mark as a Correct answer

Arun Kumar answered on August 10, 2018 14:16 (last edited on August 10, 2018 14:16)

You can use Global Requests Events to handle the page requests. This will call multiple times for images and other things, you need to filter out the requests based on your requirement and write your logic there.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.