将相关页面添加到文档时发生的事件
答
您是否尝试过使用由CMS.DocumentEngine.RelationshipInfo.TYPEINFO.Events
属性定义的全局事件?例如:
public class CustomRelationshipEvents : CMSLoaderAttribute
{
public override void Init()
{
RelationshipInfo.TYPEINFO.Events.Insert.After += Insert_After;
}
private void Insert_After(object sender, ObjectEventArgs e)
{
// Clear cache here
}
}
您CustomRelationshipEvents
属性然后添加到Kentico的CMSModuleLoader
类的扩展......
感谢。正是我想要的, – RadarBug
太棒了,请标记为已接受的答案。 – getsetcode
@RadarBug你也可以在文档中找到这些精确的代码示例。 https://docs.kentico.com/api10和https://docs.kentico.com/k10/custom-development/handling-global-events –