代码之家  ›  专栏  ›  技术社区  ›  danswain

SiteCore-在OnSavingItem事件上创建新项会将shell重定向到新创建的项

  •  3
  • danswain  · 技术社区  · 14 年前

    有个恼人的问题。

    当用户编辑项目上的字段时,我们使用OnSavingItem事件处理程序在后台的其他位置创建一些新项目。

    问题是用户编辑的项目被重定向到我们在后台创建的不可见项目。

    我们希望它留在原地…有什么想法吗?

    谢谢

    4 回复  |  直到 11 年前
        1
  •  3
  •   Bartłomiej Mucha    11 年前

    // Before we copy the item we put notifications on to make sure we won't be transfered to the newly created item                        
    Sitecore.Client.Site.Notifications.Disabled = true;
    
    // Your action comes here
    
    Sitecore.Client.Site.Notifications.Disabled = false;
    
        2
  •  0
  •   Mark Cassidy    14 年前

    <event name="item:saved">
    

        3
  •  0
  •   danswain    14 年前

        4
  •  0
  •   Alex Shyba    14 年前