TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
km b
NA
10
0
Error occured in updating SPEventReceiverDefinition
Mar 4 2010 9:34 PM
I have a another problem.I did above testing in my own computer.
When i really do to my site, the following error is occured.
First i install my assembly that contains my event class to the GAC.
I use the following code to add event to document library.
SPSite l_SPSite = new SPSite("http://mysharepointsite");
SPWeb l_SPWeb = l_SPSite.OpenWeb();
SPList l_SPList = l_SPWeb.Lists["Documents"];
string id = l_SPList.ID.ToString();
SPEventReceiverDefinition l_SPEvent = l_SPList.EventReceivers.Add();
l_SPEvent.Class = "ItemPermission.SPDocumentEventHandler";
l_SPEvent.Assembly = "ItemPermission,Version=1.0.0.0,Culture=neutral,PublicKeyToken=123770469bc80c2b";
l_SPEvent.SequenceNumber = 5000;
l_SPEvent.Type = SPEventReceiverType.ItemAdded;
l_SPEvent.Name = "CustomAddingEvent";
l_SPEvent.Update();//
Error is happened here.
Error is :
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Thanks
Reply
Answers (
1
)
Handling events in Document library.
Missing My Sharepoint Sites menu in My Links