I was recently asked to investigate an issue with Sitecore’s Web Forms For Marketers, where a null object exception would be thrown when a form was submitted. Investigating the logs I found the following line: 

Sitecore.Forms.Mvc.Controllers.ModelBinders.FormModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) 

As it turns out, Sitecore MVP Kamruz Jaman has already solved the problem, and you can see the answer here: http://stackoverflow.com/questions/26094198/save-action-on-webforms-for-marketers-throws-exeption

Essentially what you need to do is point your MVC Form rendering’s data source at the form you need to render and not the FormID field in the rendering parameters.

Sitecore Web Forms For Marketers Control Properties

Right-click and "Open image in new tab" to view at full size

I hope this helps some people save a few minutes’ investigation :)

To stay up-to-date with the latest tech news and views, be sure to check out our weekly tech round-up posts - and sign up to our mailing list to have them delivered direct to your inbox.

About the author

Charlie Afford

Charlie Afford

Charlie is a Sitecore Developer at Box UK. He is an avid supporter of Agile and Test Driven Development and believes that code quality and testability are key.

Related content

We're hiring. Let's talk. View available roles