Does the rest of the form posting work, for instace do you see your posts in edit mode after submitting the form?
EPiServer Development Team
I think I have had this problem before. If you have the same problem you need to register the event earlier in the page cycle. What i think happened for me was that the XForm had a "page after submit" set. Because of that, a redirect was made before the AfterSubmit event fired. Or the event fired but there was an event handler in the episerver code which was earlier in the chain and that event handler performed the redirect. Something like that. Either way, try to register your event handler in OnInit instead of OnLoad.
Edit: I realize that I might have misunderstood your question, but the issue might be related?
Seem to have the same issue here, worked before - change is update from Episerver 5 R2 sp1 to R2 sp2.
What did you change to make it work Viktor?
Edit: Issue for me was that mail-config was not setup properly, which sadly seem to silently swallow the exception and cancle some event but anyway save the post in database (when config on the submit-button is set to 'save-to-database and send email'). Perhaps a better approach would be to fire the exception...
I've tried firing XForm_AfterSubmitPostedData from the code-behind on the user control, and tried firing it from the Global.asax, but it just doesn't trigger. Any idea why? Put breakpoints everywhere, just doesn't work...