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