Vikram Lakhotia
The Online Weblog of Vikram Lakhotia
Sign in
|
Join
Home
Contact
About
RSS
Atom
Search
Tags
.NET
.NET FAQ
301 Redirect
AJAX
API
ASP.NET
asp.Net 3.5
Asp.Net 3.5 extension
Asp.Net 4.0
Asp.Net Ajax Extension
Asp.net MVC
Atlas
Award
Base Class Library
BCL
C#
Caching
Certification
ClientScript
Community News
comparison
compression
Content Page
Cookies
Database
deployment
Design Pattern
Dropdownlist
Encode
Event Handler
EventHandler
FindControl
Formview
General Software Development
Goto
GridView
Historical Debugger
How To
HTML
HTML Encode
IE8
IIS
IN
Incremental Crawl
Javascript
Label
LINQ
ListBox
Machine.config
Master
Master Page
Meta Tag
Microsft
MVC
MVP
MYSQL
NET
NetBook
Network
News
Observer
Open Format
Open Offcie
Oracle
ParseControl
Performance
Personal
Release
Request Validation
Security
SEO
Session
Sharepoint
Silverlight
SQL Server
SQL Server 2008
StopWatch
TechDays
teched
Training
Virtual Techdays
visual studio
Visual Studio 2010
Web Config
Web Platform Installer
Web Platform Installer 2.0
web.config
Windows 7
Windows Application
windows Forms
Windows Server 2008
Word 2007
Word Automation
Wrap
Sponsors
advertise here
News
Recieved ASIA MVP Certification Hero Award 2009
Recieved MVP Award for the year 2009
For my previous Posts, do checkout
VikramLakhotia.com
Visitors Map
Twitter Feed
Navigation
Home
Blogs
Archives
January 2011 (1)
October 2010 (1)
September 2010 (1)
August 2010 (6)
July 2010 (1)
May 2010 (1)
April 2010 (13)
February 2010 (7)
January 2010 (2)
October 2009 (3)
September 2009 (5)
August 2009 (6)
July 2009 (3)
June 2009 (1)
May 2009 (4)
April 2009 (6)
March 2009 (8)
February 2009 (2)
January 2009 (4)
December 2008 (2)
October 2008 (2)
September 2008 (1)
August 2008 (1)
July 2008 (6)
June 2008 (2)
May 2008 (2)
April 2008 (4)
March 2008 (6)
February 2008 (15)
What I Follow
Joe
MY Personal site
ScottGu
Just Like That
Farghana
Why Not
MY MVP Profile
forums.asp.net
Sharepoint Adding event handler to the list with the help of a generic Console Application
Hi,
While working with Sharepoint list many a times developers need to create special event handler for the list based on their requirement. Once the event handler assembly is created we have to deploy the Assembly in GAC. And then attach the event handler to the list for which the event handler is created.
For attaching an event handler with the list we need to create a console application which would be used to attach the event handler to the list. Normally developers create separate console application to attach event handler to the different list.
What we can easily do create a single console application which would take some parameter form a configuration file and attach the event handler with the specified list. Developers need to provide the required data to attach the event handler in the configuration file.
The zipped console application is available
here
.
The console application does the work of attaching the event handler to the list. The console application needs 5 different values from the appsettings section of the configuration file.
SiteCollectionURL
- Takes the URL of the Site where the list resides. Example – “
http://www.example.com
”
RecordListName
– Takes the name of the list on which the event handler should be attached. Example – “ListOfFriend”
EventHandlerName
– Name of the eventhandler that should be applied like ItemUpdating. If there are more than one event handler, then user can pass the venet handler as a comma seperated list ItemDeleting,ItemUpdating
ClassName
– FullName of the class where the code for the event handler has been written. Example – SharePoint.Vikram.EventHandlers.FriendList
AssemblyName
– Name of the assembly where the class for the event handler - SharePoint.Vikram.EventHandlers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=faeb5f91b6c4621e
Vikram
Attachment:
AddEventHandler.zip
Published Wednesday, January 07, 2009 7:42 AM by
vik20000in
Filed under:
.NET
,
Sharepoint
,
Event Handler
Comments
No Comments