[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-168426-105":53,"doc-detail-168426-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","microsoft-office-sharepoint-server-moss-for-developers-part-1-topic-3-programming-event-handlers","Microsoft Office SharePoint Server (MOSS) for Developers - Part 1 - Topic 3: Programming Event Handlers","","Programming event handlers in Windows SharePoint Services 3.0 extends event handling beyond document libraries to lists, sites, and user operations. The material explains synchronous and asynchronous pre/post modes, registration scopes (file, list, Web site, and levels via object model), and advanced options like canceling pre-synchronous events with custom errors. It also details how to build a basic SPItemEventReceiver using Visual Studio, override event methods (e.g., ItemDeleting, ItemAdded), access SPItemEventProperties/SPListItem data, and register handlers declaratively via features and content types.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/microsoft-office-sharepoint-server-moss-for-developers-part-1-topic-3-programming-event-handlers/168426/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/microsoft-office-sharepoint-server-moss-for-developers-part-1-topic-3-programming-event-handlers/168426.png","ImageObject",442,249,{"name":88,"@type":89},"\tWilliam","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/vnd.openxmlformats-officedocument.wordprocessingml.document","2026-09-29","2026-09-01",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",9,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"What new event capabilities does Windows SharePoint Services 3.0 add over 2.0?","Question",{"text":109,"@type":110},"Windows SharePoint Services 3.0 expands event support beyond document/form libraries to lists, sites, and user operations, with a more extensive event set and improved flexibility.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How do synchronous and asynchronous event methods differ in the SPItemEventReceiver examples?",{"text":114,"@type":110},"Methods ending in “ing” handle events synchronously before the action occurs, while methods ending in “ed” handle events asynchronously after the action occurs.",{"name":116,"@type":107,"acceptedAnswer":117},"What are the main ways to register an event handler in Windows SharePoint Services 3.0?",{"text":118,"@type":110},"Event handlers can be registered via the object model (SPWeb/SPList EventReceivers), declaratively by list type in Feature.xml using list template IDs, or declaratively by content type.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},168426,1788231290,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":136,"language":137,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":138,"faqs":139,"seo_title":140,"seo_description":61,"update_tm":126,"read_time":73},5909887254083,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Microsoft Office SharePoint Server (MOSS) for Developers\n(Part 1)\nTopic 3: Programming Event Handlers\n\u0013 HYPERLINK \"http://msdn.microsoft.com/en-us/rampup/bb352986.aspx\" \u0014\n\u0015\n\u0013 HYPERLINK \"http://msdn.microsoft.com/rampup\" \u0014http://msdn.microsoft.com/rampup\u0015\n\u000f\nIntroduction\nWindows SharePoint Services 2.0 introduced sinking events that were triggered from within a Windows SharePoint Services 2.0 document library by attaching a Microsoft .NET assembly to the document library. The event sinking was limited, however, to the document library or form library, and events were triggered only after the actual action occurred within the library. Windows SharePoint Services 3.0 goes a step further and introduces a new and extensive set of events that you can use, not only within libraries but also now within lists, sites, and user operations.\nEvents in Windows SharePoint Services 3.0 now support the following capabilities:\nYou can use pre-synchronous and post-asynchronous modes to handle events.\nYou can register events at the file, list, and Web site levels.\nYou can register multiple events per item.\nYou can cancel pre-synchronous events and display custom error messages.\nYou can register item events on generic lists, as well as on document libraries.\nYou can declaratively register events per list type or content type.\nIn addition to trapping standard list item events (for example, \u0013 HYPERLINK \"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemadding.aspx\" \u0014ItemAdding\u0015, \u0013 HYPERLINK \"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemdeleting.aspx\" \u0014ItemDeleting\u0015, or \u0013 HYPERLINK \"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdating.aspx\" \u0014ItemUpdating\u0015), you can trap schema events (such as adding, removing, or updating columns), as well as Web site and site collection deletion.\nCreating a Basic Event Handler\nThe following example shows the basic steps of creating an event handler that executes code before a list item is deleted or after an item is added. The example works on announcement lists, adding text to the body of new items, but cancelling attempts to delete existing items.\nYou create an event handler assembly in Microsoft Visual Studio 2005 by creating a class library. You add the reference to Microsoft.SharePoint.dll and inherit from the \u0013 HYPERLINK \"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.aspx\" \u0014Microsoft.SharePoint.SPItemEventReceiver\u0015 base class.\nWindows SharePoint Services 3.0 instantiates an object of your class when actions occur within the list. As a developer, you override the methods of the SharePoint base class for the events you are interested in handling. The methods of the SPItemEventReceiver class that you can override are the following:\nContextEvent\nItemAdded\nItemAdding\nItemAttachmentAdded\nItemAttachmentAdding\nItemAttachmentDeleted\nItemAttachmentDeleting\nItemCheckedIn\nItemCheckedOut\nItemCheckingIn\nItemCheckingOut\nItemDeleted\nItemDeleting\nItemFileConverted\nItemFileMoved\nItemFileMoving\nItemUncheckedOut\nItemUncheckingOut\nItemUpdated\nItemUpdating\nThe example overrides two methods: ItemDeleting and ItemAdded. Remember that the suffix \"ing\" indicates that we are handling the event in a synchronous way before the action actually occurs, and the suffix \"ed\" indicates that we are handling the event in an asynchronous way after the action occurs.\nYou have access to the data associated with the \u0013 HYPERLINK \"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.aspx\" \u0014SPListItem\u0015 object through an object that is provided as an input parameter when your method is called. This object is of type \u0013 HYPERLINK \"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventproperties.aspx\" \u0014SPItemEventProperties\u0015. Through the Cancel property of the SPItemEventProperties class you can cancel the event, and through the ErrorMessage property you can display a custo","cbCaidkZOsIeW4gO","https://ap.wps.com/l/cbCaidkZOsIeW4gO","docx",32541,6,"English","# Introduction\n## Creating a Basic Event Handler\n## Registering an Event Handler","[{\"question\":\"What new event capabilities does Windows SharePoint Services 3.0 add over 2.0?\",\"answer\":\"Windows SharePoint Services 3.0 expands event support beyond document/form libraries to lists, sites, and user operations, with a more extensive event set and improved flexibility.\"},{\"question\":\"How do synchronous and asynchronous event methods differ in the SPItemEventReceiver examples?\",\"answer\":\"Methods ending in “ing” handle events synchronously before the action occurs, while methods ending in “ed” handle events asynchronously after the action occurs.\"},{\"question\":\"What are the main ways to register an event handler in Windows SharePoint Services 3.0?\",\"answer\":\"Event handlers can be registered via the object model (SPWeb/SPList EventReceivers), declaratively by list type in Feature.xml using list template IDs, or declaratively by content type.\"}]","Microsoft Office SharePoint Server (MOSS) for Developers - Part 1 - Topic 3: Programming Event Handlers | DOCX"]