System.MissingMethodException: No parameterless constructor defined for this object

前端 未结 2 1538
攒了一身酷
攒了一身酷 2021-01-25 22:52

I\'m using MVC 2.0 with a Html.ListBoxFor as below:

<% using (Html.BeginForm()) { %>

       \" />

        <%=         


        
2条回答
  •  长发绾君心
    2021-01-25 23:45

    This error is coming from the ControllerFactory not the View. It is stating that you don't have a paramerless constructor in your Controller. The DefaultControllerFactory for ASP.NET MVC can only instantiate a Controller with a public parameter less constructor. If you plugin your own ControllerFactory and use some DI/IoC tool you can bypass this limitation.

提交回复
热议问题