Attach Document Library Event Handler in Code
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Attach Document Library Event Handler in Code

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
Harold Crump
Guest





Posted: Wed Jan 19, 2005 1:12 am    Post subject: Attach Document Library Event Handler in Code Reply with quote

Greetings,

I want to attach event handlers in a document library through code.
Is it possible?
I will have a reference to the SPWeb object as well as
SPDocumentLibrary object.

Is there any API that does this or can it be done only through the
SharePoint pages?

Thanks.
Back to top
Marco Bellinaso
Guest





Posted: Wed Jan 19, 2005 1:23 am    Post subject: Re: Attach Document Library Event Handler in Code Reply with quote

Something like this should work:

SPList docs = web.Lists["Shared Documents"];
docs.EventSinkAssembly = "full name of your assembly";
docs.EventSinkClass = "full_namespace.classname";
docs.EventSinkData = "optional settings here";
docs.Update();

HTH,
- Marco


"Harold Crump" <orientletter@yahoo.com> wrote in message
news:1106075571.128332.109850@f14g2000cwb.googlegroups.com...
Quote:
Greetings,

I want to attach event handlers in a document library through code.
Is it possible?
I will have a reference to the SPWeb object as well as
SPDocumentLibrary object.

Is there any API that does this or can it be done only through the
SharePoint pages?

Thanks.

Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB