Tuesday, July 5, 2011

EventReciever problem in Document Library in Sharepoint

For upload documents in document library SharePoint uses Asynchronous way by default.
So it gives error when we add event receiver for item Added.
So for that we go to->Elements.xml of event receiver
And add line in Item Added as->
<Receiver>
        <Synchronization>Synchronous</Synchronization>
        <Name>CollectEventReceiverItemAdded</Name>
        <Type>ItemAdded</Type>
        <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
        <Class>Leave14473Project.CollectEventReceiver.CollectEventReceiver</Class>
        <SequenceNumber>10000</SequenceNumber>
      </Receiver>


<Synchronization>Synchronous</Synchronization> is the line added here.


No comments:

Post a Comment