Server Error in '/' Application. No parameterless constructor defined for this object

前端 未结 6 2028
感动是毒
感动是毒 2021-01-11 11:55

The callstack shows the following:

[MissingMethodException: No parameterless constructor defined for this object.]
System.RuntimeTypeHandle.CreateInstance(Ru         


        
6条回答
  •  无人及你
    2021-01-11 12:28

    I also have properties on my view model class that return SelectList instances. I decorated my class with the Bind attribute to exclude these properties like this:

    [Bind(Exclude = "Countries")] public class MyViewModel { ...

    public SelectList Countries { get; set; }
    

    }

    Hope that helps, Roger

提交回复
热议问题