Publishing Delayed Page Versions


Hi All,

How can i find the event Instance_PublishingPage(object sender, PageEventArgs e) in Global.asax.cs was called by scheduler or Manual Save and Publish?

Thanks in Advance.



Jul 18, 2012 18:14

I'm not sure if there's an elegant way to do it, but you could use the fact that the scheduler doesn't run in context of a user on the site. That is, you can check if there's a logged in user in the given context. Something like this ought to do the trick:

if(PrincipalInfo.CurrentPrincipal == null || PrincipalInfo.CurrentPrincipal == PrincipalInfo.AnonymousPrincipal)
  //Assume scheduled job, or at least not a "real life editor"


Doing so won't say for certain that it was the scheduled job that triggered the event, but it will tell you that it wasn't an authenticated editor which I'm guessing is good enough.

Jul 19, 2012 13:13

Thanks for your reply Joel, I got the solution for it before Actually it should be like this below:

if(HttpContext.Current != null && HttpContext.Current.Request.RawUrl.Contains("EditPanel.aspx"))


//Manual Save and Publish




//Publish by the Scheduler


Jul 19, 2012 17:06
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.