c# - SPItemEventReceiver 类中的确认框

标签 c# javascript jquery sharepoint-2007 messagebox

我想在 SpItemEventReceiver 中显示一个确认框类仅使用 C# 或任何脚本或插件(例如 jQuery)。

我已经研究了这个问题,我相信我可以做一些事情,比如构建一个字符串并将它显示在这个项目添加表单上,但我在 this SharePoint King blog post 中读到了它(我不是在给他们做广告)如果你搜索文本是不可能的。以下是摘录:

Is there any way we can show a custom message box when an event is fired and continue with the event?
No, that is not possible from the method described here. You can put alert on button click of the form by the javascript but can not be done by an event handler.

我想知道是否有人可以确认是否可以或我们不能这样做,因为我认为我们可以但不知道如何做。这是我正在尝试的一段代码:

class className: SPItemEventReceiver
{
    public override void ItemAdding(SPItemEventProperties properties)
    {
        try
        {
            this.DisableEventFiring();
            //Display a Message box here

[编辑:] HttpContext.Response 属性是否可以在此上下文中工作?

最佳答案

显示消息框在这里不起作用;如果有效,消息框将显示在服务器上,因为这是运行此代码的地方。您可以在服务器端使用的是 SharePoint

页面状态MSDN

关于c# - SPItemEventReceiver 类中的确认框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13231270/

相关文章:

c# - 使用 HttpPostedFileBase 的强类型模型无法搭建 View

c# - ProtoBuf-net 序列化 IEnumerable<T>

c# - 循环运行太快?

javascript - meteor ,如何更改事件模板( View )?

javascript - 如何使用单个模态显示多个图像

javascript - 如何在php中获取脚本变量值

c# - 如何在 C# 中安排代码在编译时运行

javascript - 将按钮添加到新的顶部工具栏?

javascript - $.post throw "Illegal invocation "

jquery - 保持文本区域和按钮等高