No parameterless constructor defined for this object. – Gridview DataBind ASP.NET

Error:

An exception of type ‘System.MissingMethodException’ occurred in mscorlib.dll but was not handled in user code

Additional information: No parameterless constructor defined for this object.

 

Possible Solution:

If defining your gridview’s data source in the ASP.NET markup. Make sure the code behind’s constructor is public and has the right visibility.

In my case, Resharper suggested making the constructor protected, which this problem.

Leave a Reply