ASP.NET MVC 3 Ajax.BeginForm resetting model values unexpectedly

german95

New Member
I have a partial view which contains the following snippet:\[code\]@model Mbrrace.Domain.MbrraceForm<div class="row"> <div class="span12 form-horizontal"> @using (Ajax.BeginForm("DetailsSection11", "DataForm", new AjaxOptions { HttpMethod = "POST", OnComplete = "NextTab" } ))\[/code\]In the controller which calls the view which displays this partial view some of the model values are preset but not displayed or otherwise used. When the Ajax submit happens some of these values have been cleared (ints changed to zero and strings to null) however a date value is preserved. The values set in the form itself are returned correctly.I have checked that the preset values are correct when they reach the form using @Html.DisplayFor to display them.I use Ajax.BeginForm and models elsewhere in the solution with no problems at all. I have checked that the ModelState before and after submitting and it is valid. I have also tried ModelState.Clear() with no effect.Any ideas what the problem might be before I tear out what little is left of my hair.
 
Back
Top