'System.Web.UI.WebControls.ListItem' in Assembly 'System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable

Error drove me nuts... simple solution

You get this error when you are trying to Bind a DropDownList in a GridView, but the problem is that you are using the wrong property to bind it...

instead of:
SelectedItem='<%# Bind("some_value") %>'

use this:
SelectedValue='<%# Bind("some_value") %>'

Simple, but easy to overlook.
Comments are closed