Cant get PageEventhandlers to fire and non working example in SDK
Vote:
Example from SDK:
//Modify values for page properties when loading the page for editing in edit mode
public class Global : EPiServer.Global
{
protected void Application_Start(Object sender, EventArgs e)
{
EditPanel.LoadedPage += new LoadedPageEventHandler(EditPanel_LoadedPage);
}
protected void EditPanel_LoadedPage(EditPanel sender, LoadedPageEventArgs e)
{
e.Page.PageName += "[Test]";
e.Page["PageChangedOnPublish"] = true;
}
"The type or namespace EditPanel could not be found...."
Also I cannot get any of the Pageeventshandlers in Global.asax to fire. When using for example:
DataFactory.Instance.LoadingPage += new PageEventHandler(Instance_Loading);
//Jocke
PageEventHandlers not fireing problem is solved, missmatach betwwen global.asax and global.asax.cs :/
But the example from the SDK still not working...
Hi Joakim!
Thank you for pointing out that there is a mismatch between the global.asax and the global.asax.cs file. We are looking into this. For anyone else that is having this problem just change the inherits attribute of the Global.asax file to "EPiServer.Templates.Global".
After I did this I got the sample working. I had to add a reference to the EPiServer.UI for my project and also add using EPiServer.UI.Edit; to the Global.asax.cs file.