Try our conversational search powered by Generative AI!

XForms and "Page shown after the form has been sent" not working


I have created a XForm page, where I've selected a page to be shown after the form has been submitted.When running the site on my own computer this works as expected (data is saved, mail is sent and redirection happens). However in production, only saving the data and sending the email is done, no redirection.


Anybody got an idea about how I can solve this? 

Oct 28, 2011 13:33

Usually has something to do with the SMTP-server. Since sending is done it might not respond in the way EPiServer requires.

Oct 28, 2011 15:25

Johan is correct, AfterSubmitPostedData will not trigger if the SMTP fails at sending the mail. Do you get the redirect if you only save the data to the database, removing the mailing from the equation?

Here is a page with further ideas on what might be wrong:

Oct 29, 2011 16:16

It fails to redirect even when it's set to only save the data to the database. When set to save to database and send mail it does both, but still not redirecting. 

I have also tried and checked everything mentioned on that blog. Guess I'll have to debug further.


Oct 31, 2011 11:30

Hm, I recall having to do the redirect manually once, can't remember why though. Added something like

xForm.AfterSubmitPostedData += xForm_AfterSubmitPostedData; //where xForm was the XFormControl

in the OnInit event on my UC, and

private void xForm_AfterSubmitPostedData(object sender, SaveFormDataEventArgs e)
     var xFormControl = (XFormControl)sender;

     if (xFormControl.FormDefinition.PageGuidAfterPost == Guid.Empty)
     var pageMap = PermanentLinkMapStore.Find(xFormControl.FormDefinition.PageGuidAfterPost) as PermanentPageLinkMap;
     if (pageMap == null)

Not so pretty, I know, but it was only for one of my own playground projects.

Oct 31, 2011 12:45

Could the issue be related to IIS? The site is hosted on a server running IIS 6 (and thus classic mode instead of integrated mode).

Nov 25, 2011 15:55

How does your global.asax.cs look? The redirection code should be there. The test form you´re using is it the same on both your local and remote server? Make sure under MailSettings in web.config that you´ve set the from email address to a valid email address, same in the form.


Nov 26, 2011 13:20
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.