保存 Sitecore 项目时,我试图显示一个弹出窗口以与用户交互。根据他们更改的数据,我可能会显示一系列 1 或 2 个弹出窗口,询问他们是否要继续。我已经想出了如何利用 OnItemSaving 管道。这很简单。我想不通的是如何显示一个弹出窗口并对用户的输入做出反应。现在我在想我应该以某种方式使用 Sitecore.Context.ClientPage.ClientResponse 对象。这是一些代码,显示了我正在尝试做的事情:
public class MyCustomEventProcessor
{
public void OnItemSaving(object sender, EventArgs args)
{
if([field criteria goes here])
{
Sitecore.Context.ClientPage.ClientResponse.YesNoCancel("Are you sure you want to continue?", "500", "200");
[Based on results from the YesNoCancel then potentially cancel the Item Save or show them another dialog]
}
}
}
我应该使用不同的方法吗?我看到还有 ShowModalDialog 和 ShowPopUp 和 ShowQuestion 等。我似乎找不到关于这些的任何文档。此外,我什至不确定这是否是执行此类操作的正确方法。