XForm events not firing

Vote:
 
Hi, I'm experiencing a problem with XForms on one project that I've not had before. The ControlsCreated event is firing as expected but for some reason, despite the page being valid, the AfterSubmitPostedData event is not firing. The code for setting up the event is below. Has anyone ever experienced this before? Thanks, Justin private void Page_Init(object sender, System.EventArgs e) { if (CurrentPage.Property["MainXForm"].IsNull) { return; } SetupForm(); FormControl.FormDefinition = Form; FormControl.BeforeReadingPostedData += new SaveFormDataEventHandler(FormControl_BeforeReadingPostedData); FormControl.BeforeSubmitPostedData += new SaveFormDataEventHandler(FormControl_BeforeSubmitPostedData); FormControl.AfterSubmitPostedData += new SaveFormDataEventHandler(FormControl_AfterSubmitPostedData); FormControl.ControlsCreated += new EventHandler(FormControl_ControlsCreated); }
#12922
Feb 02, 2007 19:25
Vote:
 
Hi Justin, I had the same problem. My solution was the move code for setting up the form event to the OnInit method. Your code should look something like this: private void Page_OnInitEventArgs e) { base.OnInit(e); if (CurrentPage.Property["MainXForm"].IsNull) { return; } SetupForm(); FormControl.FormDefinition = Form; FormControl.BeforeReadingPostedData += new SaveFormDataEventHandler(FormControl_BeforeReadingPostedData); FormControl.BeforeSubmitPostedData += new SaveFormDataEventHandler(FormControl_BeforeSubmitPostedData); FormControl.AfterSubmitPostedData += new SaveFormDataEventHandler(FormControl_AfterSubmitPostedData); FormControl.ControlsCreated += new EventHandler(FormControl_ControlsCreated); } I hope this helps you solve your problem. Best Regards, Christian
#15094
Mar 05, 2007 13:24
Vote:
 
Hello you can get this problem when you try to send email from the form and the SMTP property not is correct /snive
#15095
Feb 11, 2008 11:47
Vote:
 

I got this problem, but it only appeared if the page to show after posting was set. If it was set, for some reason the AfterSubmitPostedData event did not fire.

#25748
Nov 04, 2008 9:49
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.