loads of useful information, examples and tutorials pertaining to web development utilizing asp.net, c#, vb, css, xhtml, javascript, sql, xml, ajax and everything else...

 



Advertise Here
C-Sharpener.com - Programming is Easy!  Learn Asp.Net & C# in just days, Guaranteed!

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

by naspinski 9/8/2009 6:28:00 AM

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.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

asp.net

Related posts


Comments are closed