1
votes

I'm trying to get Webforms for Marketers to work in a Sitecore Mvc website. The form renders normally, but upon submitting the form a NRE occurs.

[NullReferenceException: Object reference not set to an instance of an object.]
 Sitecore.Forms.Mvc.Controllers.ModelBinders.FormModelBinder.BindModel(ControllerContext   controllerContext, ModelBindingContext bindingContext) +536
 System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +436
 System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +152
 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +641

The error occurs with both newly created forms and with unmodified Sample Forms. I've tested using the default "Tell a Friend" and the "Send an Email" Actions. I've encountered no problems using these forms and actions outside the Mvc environment (Regular and Mvc Multi-site). I'm using Sitecore 7.5 and WFFM 2.5.

I've found Save Action on webforms for marketers throws exception as a duplicate. Important emphasis, the DataSource requires not the path shown at Form ID, but the actual Form ID you can view through Raw Values.

1
Initially the suggested solution by stackoverflow.com/questions/26094198/… didn't appear to work for me. Apparently I misinterpreted the solution. The DataSource needs the actual ID and not the path (i.e. use Raw Values to view the ID). - Frank

1 Answers

0
votes

This exeptions means that some object is set to null and youre asignig value to its member.

if im right youre asigning viewmodel data to some domain model, and the reason you get exepton is youre domain model is null, firts you must create instance of that model and than give it some value

DomainModel yourModel = new DomainModel();
//and than you must give to yourModel objects properties some values

P.S Debugging is your best friend in such situations