{"id":135,"date":"2010-12-12T17:16:00","date_gmt":"2010-12-12T23:16:00","guid":{"rendered":"https:\/\/www.chrystalsander.com\/blog\/?p=135"},"modified":"2010-12-12T17:16:00","modified_gmt":"2010-12-12T23:16:00","slug":"sharepoint-eventhandler-basics","status":"publish","type":"post","link":"https:\/\/www.chrystalsander.com\/blog\/?p=135","title":{"rendered":"SharePoint EventHandler Basics"},"content":{"rendered":"<p><span style=\"font-weight: bold;\">NEW IN 3.0:<\/span><\/p>\n<p>\u2022  You can use pre-synchronous and post-asynchronous modes to handle events.<br \/>\u2022  You can register events at the file, list, and Web site levels.<br \/>\u2022  You can register multiple events per item.<br \/>\u2022  You can cancel pre-synchronous events and display custom error messages.<br \/>\u2022  You can register item events on generic lists, as well as on document libraries.<br \/>\u2022  You can declaratively register events per list type or content type.<br \/>\u2022  In addition to trapping standard list item events (for example, ItemAdding, ItemDeleting, or ItemUpdating), you can trap schema events (such as adding, removing, or updating columns), as well as Web site and site collection deletion<\/p>\n<p><span style=\"font-weight: bold;\">CREATING AN EVENTHANDLER:<\/span><\/p>\n<p>\u2022  Create an event handler assembly by creating a class library. Add reference to the Microsoft.SharePoint.dll and inherit from the Microsoft.SharePoint.SPitemEventReceiver base class:<br \/>                  Public class SimpleEventHandler : SPItemEventReceiver, \u2026<\/p>\n<p><span style=\"font-weight: bold;\">REGISTERING AN EVENT HANDLER:<\/span><\/p>\n<p>\u2022.Add<br \/>\u2022By list template ID<br \/>\u2022Declaratively by content type<\/p>\n<p><span style=\"font-weight: bold;\">NOTE:<\/span> must be strongly named and registered in the GAC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NEW IN 3.0: \u2022 You can use pre-synchronous and post-asynchronous modes to handle events.\u2022 You can register events at the file, list, and Web site levels.\u2022 You can register multiple events per item.\u2022 You can cancel pre-synchronous events and display custom error messages.\u2022 You can register item events on generic lists, as well as on &hellip; <a href=\"https:\/\/www.chrystalsander.com\/blog\/?p=135\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SharePoint EventHandler Basics&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"_links":{"self":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/135"}],"collection":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":0,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}