November Happy Hour will be moved to Thursday December 5th.

PageRouteHelper getting the start page on publish event

Vote:
 

Hi 

I have the below code in my model to get the current page instance, it works fine on view of the page but on click of the publish button it returns the Site start page (which is causing the subsequent logic to fail.) 

var currentPage = ServiceLocator.Current.GetInstance().Page;

NOTE : There are no logic on the publish event in the init module.

Any ideas why it would behavior like this? 

#147603
Apr 19, 2016 17:42
Vote:
 

As you mention "model" I guess you're using MVC? In that case the model is usually populated with the current page from the Controller, not containing any logic itself to determine the current page.

Could you give some more information about what you're trying to do and what your setup is?

#147607
Apr 19, 2016 18:46
* 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.