Rendering XForm in MVC


Which method is the preferred way of rendering a XForm in MVC?



, new { XFormParameters = new XFormParameters() { SuccessAction = "Success", FailedAction = "Failed", PostAction = "XFormPost" } })


@using Html.BeginXForm(Model.XForm)
new XFormParameters() { SuccessAction = "Success", FailedAction = "Failed", PostAction = "XFormPost" })

Second question:

When using alternative one of the above I don't get the form back after making a post in a XForm, not even reloading the page. All I get is the message you get after making a post. Anyone who knows why? I don't do anything special in the controller actions for success and failure.

Jul 05, 2013 11:33

Take a look at Although this particularly covers implementation in a block, you could also use it for page integration.

I prefer to use the latter way of rendering, since it gives me a little more control over the output of the form. 

After you implement one of the methods, check the action attribute that's rendered on the form tag and see if you have a MVC action to handle it.

Jul 05, 2013 15:36
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.