SharePoint Web Part Properties Error when class not Serializable

SharePoint Web Part Properties Error when class not Serializable

 

I came across an issue the the other day when adding a web part property to a SharePoint 2010 web part. My web part property was a List<> of a custom class and I was updating this property using a custom editor part.

I packaged and deployed the web part but when I hit Apply or OK in the toolpane I received the following error message:

SharePoint Web Part Property Error

 

 

Well it turns out I had forgotten to mark my custom class as Serializable! As soon as I did that the web part worked flawlessly.

Hope this helps Smile

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">