Try our conversational search powered by Generative AI!

XForms and MVC - BeforeSubmitPostedData


We´re using XForms on our EPiServer 7 + MVC site. On our XFormPage we´re trying to read and modify what ChannelOptions the form should use by subscribing to the BeforeSubmitPostedData event. The event fires alright, but the ChannelOptions is always None when trying to read it. Are we doing anything wrong here?

public class XFormPageController : PageController<XFormPage>

    public ActionResult Index(XFormPage currentPage)

        XFormActionHelper.BeforeSubmitPostedData += OnBeforeSubmitPostedData;

        return View(currentPage);

    private void OnBeforeSubmitPostedData(object sender, XFormDataEventArgs e)

        // e.FormData.ChannelOptions is always None



Jan 10, 2013 17:25

In your view, how are you adding the XForm? I believe there's an overload to the method where you can pass in some parameters for this.


Jan 10, 2013 18:39

The view looks like this:

@Html.DisplayFor(m => m.XForm, new { XFormParameters = new XFormParameters() { SuccessAction = "Success", FailedAction = "Failed"} })

Jan 11, 2013 8:58

I see this was never answered. I have the same issue.

Apr 02, 2014 17:37


Any answeres on your question? Did you solve it?

I would be grateful if you posted your solution.

Sep 18, 2014 13:14

I would like to also see the answer, please.

Dec 11, 2014 17:00
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.