November Happy Hour will be moved to Thursday December 5th.

Stop a XForms post in MVC?

Vote:
 

Hi!

I am trying to do some serverside validation with the data sent with a XForm on a MVC solution and if the validation fails I want to stop the post.

I got a small problem with XFormActionHelper.BeforeSubmitPostedData. I am able to catch the Xform post before the actuall post but I am not able to stop the post with the

XFormDataEventArgs CancelSubmit.

What is the correct way to handle this?

Many thanks!

/ Henrik

#116599
Feb 03, 2015 11:47
Vote:
 

Hi Henrik,

I've wrote a blog post of xForms validation with Google reCAPTCHA maybe te code in my blog can help you.

http://www.patrickvankleef.com/2015/01/29/episerver-xforms-recaptcha-webforms-implementation/

Regards,

Patrick

#116603
Feb 03, 2015 12:48
Vote:
 

Posted wrong link, I created two blog post one for webforms and one for MVC:

http://www.patrickvankleef.com/2014/12/22/episerver-xforms-recaptcha-mvc-implementation/

#116633
Feb 03, 2015 13:22
Vote:
 

Thanks Patrick! Youre blog post pointed me in the right direction.

#116803
Feb 05, 2015 9:10
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.