Introduction to eventhandler in Moss

Source: Internet
Author: User

When we operate on a document library, some events will actually be triggered in Moss. At this time, we can use eventhandler to handle them. The following is my summary:
1. Create a class library in
Using system;
Using system. Collections. Generic;
Using system. text;
Using Microsoft. SharePoint;
Namespace myeventhandler
{
Class showeventhandler: spitemeventreceiver
{
Public override void itemadded (spitemeventproperties properties)
{
}
}
}
2. Right-click the project name-properties and add a strong name to the project.
3. Compilation and generation
4. Place the generated DLL in GAC.
5. Modify the Web. config of the eventhandler event website in IIS and add a node in <safecontrols>, for example:

<Safecontrol Assembly = "myeventhandler, version = 1.0.0.0, culture = neutral, publickeytoken = 20070753c4e759bf"

Namespace = "myeventhandler" typename = "*" Safe = "true"/>
6. Open "Management Center> application ".ProgramManagement> Web Application General Settings "enable" backward compatible event handlers"
7. Add processing events for the document library: settings-document library management-advanced settings, and enter in the Assembly:

Myeventhandler, version = 1.0.0.0, culture = neutral, publickeytoken = 20070753c4e759bf, in the Class Name field:

Myeventhandler. showeventhandler

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.