Login

How do I disable the "Mark page as changed" box in edit mode?

Versions: n/a, FAQ number: 150, Old FAQ number: 5173

To hide the checkbox you need to attach to the event that is run when the page is loaded and set the that propertys, PageChangedOnPublish, property OwnerTab to -1, or EditTab.None which is the same.

protected void Application_Start(Object sender, EventArgs e)
{
  EPDataFactory.LoadedPage += new PageEventHandler(EPDataFactory_LoadedPage);

  EPDataFactory.LoadedDefaultPageData+= new EPiServer.PageEventHandler(EPDataFactory_LoadedPage);
}

 
private void EPDataFactory_LoadedPage(object sender, PageEventArgs e)
{
  PropertyData prop = e.Page.Property "PageChangedOnPublish"] as PropertyData;      

 

  if (prop != null)
  {
    prop.OwnerTab = (int)EditTab.None;
  }
}

EPiTrace logger