1. Microsoft.SharePoint.dll

Create EventFiring.cs 1.Right-click on the project, select Add and click on New Item. 2.In the templates pane, select Class. 3.Enter the Name as EventFiring and then click OK. 4.Replace EventFiring.cs with the following code:   using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Microsoft.SharePoint;

namespace DisableEventFiring

{

public classEventFiring : SPItemEventReceiver

{

public void DisableHandleEventFiring()

{

this.EventFiringEnabled =false;

}

public void EnableHandleEventFiring()

{

this.EventFiringEnabled =true;

}

} }

Program.cs 1.Replace Program.cs with the following code:   using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Microsoft.SharePoint;

namespace DisableEventFiring

{

class Program

{

static void Main(string[] args)

{

using (SPSite site = new SPSite("https://serverName/sites/Vijai/"))

{

using (SPWeb web = site.OpenWeb())

{

SPList list = web.Lists.TryGetList("Custom");

SPListItem item = list.GetItemById(34);

item["Title"] ="Updated Successfully";

EventFiring eventFiring = newEventFiring();

eventFiring.DisableHandleEventFiring();

item.Update();

eventFiring.EnableHandleEventFiring();

Console.WriteLine("Updated Successfully");

Console.ReadLine();

}

}

}

} }

Programmatically Disable Event Firing on List Item Update in SharePoint 2010的更多相关文章

  1. SharePoint 2010 用Event Receiver将文件夹自动变成approved状态 (2)

    接上篇,先贴ItemUpdated的代码: base.ItemUpdated(properties); if (properties.ListItem.FileSystemObjectType != ...

  2. SharePoint 2010 用Event Receiver将文件夹自动变成approved状态 (1)

    当开发一个sharepoint门户网站,或者是一个内容管理的网站的时候,站点的模板通常会选用publish portal,或者是开启了publishing feature来对内容进行版本控制和流程控制 ...

  3. [SharePoint 2010] Copy list item with version history and attachment

    private void MoveItem(SPListItem sourceItem, SPListItem destinationItem) { if (sourceItem == null || ...

  4. Creating SharePoint 2010 Event Receivers in Visual Studio 2010

    转:http://msdn.microsoft.com/en-us/library/gg252010(v=office.14).aspx Summary:  Learn how to create a ...

  5. appium()-The event firing

    原文地址:https://github.com/appium/java-client/blob/master/docs/The-event_firing.md since 4.1.0 The purp ...

  6. 批量删除SharePoint 2010的List中的item

    第一种方式:循环遍历List中的所有item,然后根据条件去判断当前item是否应该被删除[注:要用 i-- 方式去遍历,这也是删除集合里面item的常用做法,如果用 i++ 的方式去遍历删除,会出错 ...

  7. 解决在SharePoint 2010/2013部署自己的Event Handler后,抛出”不能载入被引用的第三方的程序集"的问题

    今天在处理客户的一个问题的时候.我们已经把我们SharePoint EventHandler依赖的第三方的TIBCO.EMS.dll注冊到GAC里面了,可是日志里面还是抛出了不能载入被引用的第三方的程 ...

  8. jsom sharepoint 2010 循环获取多个list的item值

    <script type="text/javascript"> // <![CDATA[ var chongdianbaId; var elm = documen ...

  9. C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据

    转载:http://www.cnblogs.com/kivenhou/archive/2013/02/22/2921954.html 操作List前请设置SPWeb的allowUnsafeUpdate ...

随机推荐

  1. C++Builder 也有StringBuilder

    System::Sysutils::TStringBuilder *sb = new TStringBuilder;    sb->Append("ww");    sb-& ...

  2. LevelDB 的缺憾

    [LevelDB 的缺憾] 1.Snapshots 只能通过 DB::GetSnapshot() 创建,意即只能创建当下的 Snapshot. 2.

  3. strip命令

    去掉文件里调试和符号信息,文件大小变小,一般在发布的时候使用. 主要作用于可执行文件,动态库,目标文件等. 可参考:http://blog.csdn.net/stpeace/article/detai ...

  4. APP测试功能点总结

    1.功能性测试:   ——根据产品需求文档编写测试用例. ——软件设计文档编写用例.注意:就是根据产品需求文档编写测试用例而进行测试. 2.兼容性测试:   ——android版本的兼容性 ——手机分 ...

  5. Linux运维实战之DNS(bind)服务器的安装与配置

    转自http://sweetpotato.blog.51cto.com/533893/1598225 上次博文我们讨论了DNS的基础,本次博文我们重点来看看如何配置一台DNS服务器. [本次博文的主要 ...

  6. win8上部署.net4.0程序到iis

    在win8.1上默认的iis版本为8.5版,不做任何配置回报3个错误, 一下是错误提示内容及解决方案 1>HTTP 错误 404.3 – Not Found由于扩展配置问题而无法提供您请求的页面 ...

  7. Java多线程同步方法

    一.同步方法 即有synchronized关键字修饰的方法. 由于java的每个对象都有一个内置锁,当用此关键字修饰方法时, 内置锁会保护整个方法.在调用该方法前,需要获得内置锁,否则就处于阻塞状态. ...

  8. 一起做RGB-D SLAM(8) (关于调试与补充内容)

    “一起做”系列完结后,我收到不少同学给我的反馈.他们提了一些在程序编译/运行过程中的问题.我把它们汇总起来,组成了这个“补充篇”.你也可以看成是一个Q&A. Q: OpenCV的版本?A: 我 ...

  9. sqlserver怎么将excel表的数据导入到数据库中

    在数据库初始阶段,我们有些数据在EXCEL中做好之后,需要将EXCEL对应列名(导入后对应数据库表的字段名),对应sheet(改名为导入数据库之后的表名)导入指定数据库, 相当于导入一张表的整个数据. ...

  10. [GO]go context的deadline方法

    package main import ( "time" "context" "fmt" ) func main() { d := time ...