views:

989

answers:

1

Simply put, I have a custom editForm.aspx in a document library, that uses my own custom dll. When a user edits a record, I can update all the properties associated with the file, however, when you update the actual document(ie replace it) and then Update() (Or SystemUpdate()), you get the following :

The file BLAH.doc has been modified by DOMAIN\ACCOUNT on 01 May 2009 09:41:12 +0100.

The file is replaced, but none of the file properties are updated, so path, and filename are the same as the old version!?

this posting: http://hristopavlov.wordpress.com/2008/05/14/uploading-a-file-event-receivers-the-file-has-been-modified-by/ suggests using event recievers, as does anyone who has a similar problem with workflows, using DisableEvents(). Which is great, but I have no idea how to change my editform to work with an event reciever. Is there any documentation/tutorials about updating a file in a document library, and how to use event receivers to accomplish this?

+1  A: 

The event receiver would be completely separate from the edit form - You don't do anything special in the edit form beyond saving whatever the user entered. The event receiver will be called when the item is modified by either your form or one of the standard ones.

Tom Clarkson