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. 2.spring整合ehcache 注解实现查询缓存,并实现实时缓存更新或删除

    转自:http://www.importnew.com/23358.html 写在前面:上一篇博客写了spring cache和ehcache的基本介绍,个人建议先把这些最基本的知识了解了才能对今天主 ...

  2. 利用MemoryAnalyzer进行OutOfMemoryError的诊断分析

    这篇帖子只介绍利用MemoryAnalyzer进行简单的JVM的堆的分析,至于JVM的内部结构是怎么样的,这里不进行分析.好吧,废话不多说:首先如果我们要分析JVM某个时刻的Heap的对象分配情况,我 ...

  3. URL的名称设置

    1. 对于login.html 此为跳转文件, 加入了参数nid,在views.py中进行关于request.POST.get()的文件中获取 <a href='/detail?nid={{k} ...

  4. Spring Boot实践——基础和常用配置

    借鉴:https://blog.csdn.net/j903829182/article/details/74906948 一.Spring Boot 启动注解说明 @SpringBootApplica ...

  5. Maven(八) Maven项目和testng结合应用

    要想使maven结合testng只需要在pom.xml文件中加入如下信息: <build>         <plugins> <!-- invoke testng.xm ...

  6. C#流对象使用完后不立即释放的问题

    public class testwriter : MonoBehaviour { // Use this for initialization void Start () { } [MenuItem ...

  7. Struts 2 常用技术

    目录  Struts 2 常用技术  1. 常用类和接口  1.1 getter 和 setter 方法  1.2 Action 接口  1.3 ActionSupport 类  1.4 通过 Act ...

  8. ConcurrentDictionary内部机制粗解

    ConcurrentDictionary是线程安全类,是什么在保证? 内部类 private class Tables { internal readonly Node[] m_buckets; // ...

  9. S EAI 客户主数据导入_test(detail)

    一. 客户主数据模板导出 客户主数据和新联系人导入 Account_Config.ini文件 [Public] ConnectString=host="siebel://10.10.1.15 ...

  10. Django基础模板案例

    想要用django  访问一个页面 同时传参数过去.在页面中接受参数 案例:附代码 #创建一个项目 项目名字是 yhl_test django-admin startproject yhl_test ...