I am using MVC3 and am trying to leverage the Child Action feature @Html.Action()
so I have a View with the following
@foreach (var item in Model.Items){ @Html.Action("GetFormItemView", "Question", item}); }
This calls the following method
[ChildActionOnly] public ActionResult GetFormItemView(FormItem formItem) { if (formItem is FormSection) { return GetSectionView(formItem as FormSection); } else if (formItem is QuestionItem) { return GetTypedQuestionView(formItem as QuestionItem); } else { throw new NotImplementedException(); } }
At this point the Model Bind bombs telling me it can't create an abstract class....
Server Error in '/' Application. Cannot create an abstract class. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: Cannot create an abstract class.
How do I get the model binder to get out of my way - I have provided the Action with the necessary model...?