Our monthly Virtual Happy Hour is happening this week, Fri Feb 23!

Try our conversational search powered by Generative AI!



I try to add a XForm property by using 

@Html.XForm(Model.FormArea, new XFormParameters() { SuccessAction = "Success", FailedAction = "Failed" })

The form render fine, but the action method of the form gets like:

<form action="/Contact/Contact-form/XFormPost/?XFormId=72d701fe-c2e9-4bd2-b989-9f50ace5e342&amp;postAction=XFormPost&amp;postController=&amp;failedAction=Index&amp;successAction=Index"
class="form xform"

No matter what parameters I'm including in the @Html.XForm helper, I always get the action string like the one above.

When clicking the submit button my ActionResult method named XFormPost get hit, but what to do next? Since my Success and Failure ActionResult methods never get hit how can I know when the form is validated or when it's ready to save?

Any help would be appreciated!


Feb 05, 2013 13:29

Hi, I have posted earlier the code that is working just fine for me:


It's the last post by me on the page, perhaps this will help you.

Feb 05, 2013 13:39

I think I've read that post a hundred times, but still couldn't figure out why it didn't work. After one last read I finally saw the difference.

I've been giving the @Html.XForm method the parameters specified by: new XFormParameters() {SuccessAction = "Success", FailAction = "failure"}

but it should be

new {XFormParameters = new XFormParameters() {SuccessAction = "Success", FailAction = "failure"}

Thaknk you!

Feb 05, 2013 14:10
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.