0

I am working with WSS 3.0 and trying to set some permissions with the ItemAdded-Event. The problem is, that the event dont fire if I add an item. I've searched the whole web and found nothing. It is only on ItemAdding / ItemAdded, yet I have already implemented a ItemUpdating and ItemDeleting Event which are working perfect! Are there known issues?

This is my Event (It not even get my debugmessages.. :( ):

      public override void ItemAdded(SPItemEventProperties properties)
      {
        Debug.WriteLine("ItemAdded started.");
        PMDB_ContentType_Class pmClass = new PMDB_ContentType_Class();

        pmClass.SetPermissions(properties);


        Debug.WriteLine("ItemAdded ended.");
      }

This is the feature.xml

<?xml version="1.0" encoding="utf-8"?>
<Feature Id="34e2c6bd-0e9f-4a65-b280-3cd4c5ff5cb4" Title="PMDB_ContentType"           
Scope="Site" Version="1.0.0.0" Hidden="FALSE" DefaultResourceFile="core" 
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="PMDB_ContentType\PMDB_ContentType.xml" />
</ElementManifests>
</Feature>
cut33h
  • 3
  • 2

1 Answers1

0

1 >> I hope that you have attached you event with your list properly in FeatureActivated Event receiver of Feature. I cannot check that because you haven't post that code. please check if there are any errors in that code.

2 >> Use Sharepoint Manager (http://spm.codeplex.com/releases/view/51438) to see if your event is properly attached to your list or not. if not then try to deactivate feature from web UI and reactivate it again.

Raheel
  • 595
  • 8
  • 21
  • Thanks for the tip with sharepoint manager! I'm an trainee so im a big noob :D It seems like SharePoint did not accepted the EventReceiver for this list. Sharepoint Manager just show up my ItemDeleting and ItemUpdating Event.. hm.. but I added the "itemAdded"-Event in the same way... (uncommented the method in the ItemEventReceiver.cs) I dont understand your first point you meantioned! If you mean my feature.xml i have added this code now at the top here – cut33h Aug 16 '12 at 06:09
  • I am assuming that you are writing this event for specific custom list. right? if yes then uncommenting the method is not enough. You need to bind this event with your list using FeatureActivated event of feature. In solution explorer, expand your feature and see if there is any cs file with featureActivated method in it. see http://msdn.microsoft.com/en-us/library/ee231604.aspx – Raheel Aug 16 '12 at 07:03
  • i'm writing this event for a custom content type in a list – cut33h Aug 16 '12 at 07:33
  • and no there is no .cs with a featureactivated.. :/ – cut33h Aug 16 '12 at 08:14