I am trying to develop a wWebPart for displaying items from a document library and let users modify each items metadata. When user updates any documents metadata it will raise an event receiver to do some custom operations and sometimes regenerate the document with updated properties.
Whenever user updates metadata from WebPart and submits changes the page reloads showing updated properties for documents. Now the problem is when a document is being regenerated in event receiver user sees old document on WebPart, making them feel like document is not regenerated even if it supposed to be regenerated. Although when user reloads page he will see new document with updated changes as event receiver processing is completed.
Please suggest solution to this incorrect behaviour. I do not want to display old documents on WebPart if it is being submitted for new changes and it is still being processed in event receiver.