Windows Firewall pointservices3.0

Source: Internet
Author: User

This section describes how to develop and register a list entry event handler. This event handler scenario: adds an information item to the "employee information" list. If the "name" is blank, the addition is canceled, if a notification is added to the "Notification" List of the website. We will overload the itemadding and itemadded methods of the spitemeventreceive receiving class, and use the object model to register the event handler.

(1) Develop an event processing assembly

Create a class project demoinfoeventhandler in Visual Studio 2005, modify the class1.cs file name to demohandler, add a reference to Microsoft. Sharepoint. dll, and add a signature to the project. The demohandler. CS code is as follows:

Compile the project and drag demoinfoeventhandler. DLL to the C: "Windows" assembly directory.

(2) register the event handler

Create a console program registereventhandler, add a reference to microsfot. javaspoit. dll, and write the following code in the main method of program. CS:


In this way, the event handler in the "employee information" list is registered, and you can test the event handler on the website.



Source code: eventhandler
"This article is the result of my work. If you have reprinted it, please indicate the source! Thank you for your cooperation ."

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.