0

I'm trying to use T4MVC in my ASP.NET MVC4 application. I'm inserting it in my view as shown below:

@using (Ajax.BeginForm(MVC.Check.Lead(), 

The Lead method takes an integer ID parameter which is supplied in the form itself. In the documentation T4MVC state that a parameter-less constructor should be auto generated however the compiler says that there isn't.

Why is it not generated?

John Mayer
  • 3,313
  • 3
  • 19
  • 20

2 Answers2

0

Well I figured it out myself. My controller action returned a string which apparently is not suppported by T4MVC. So I changed it to partialviewresult and it works now.

John Mayer
  • 3,313
  • 3
  • 19
  • 20
0

Another possible reason (for future viewers) is that your action is inherited. It works but T4MVC will not automatically make your base actions virtual and it will not generate the parameter-less overload.

Pluc
  • 2,909
  • 1
  • 22
  • 36