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.
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.
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