Tip: not marked as serializable

Mar 24, 2011 at 12:36 AM

If you are trying to include an object in your viewstate and you get an error "... Blah is not marked as serializable"

You may need [NonSerialized] attribute. It is perplexing that this had to be applied to a private field which is in another project.

		private Blah _blah;
		internal Blah Blah
			get { return _blah ?? (_blah = new Blah()); }
			set { _blah = value; }