Contact Us

Home > Error Serializing > Error Serializing Value 'system.collections.generic.list

Error Serializing Value 'system.collections.generic.list

By bad design, in my opinion. EMAIL US MenuExperts Exchange Browse BackBrowse Topics Open Questions Open Projects Solutions Members Articles Videos Courses Contribute Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Ask a IList implementation, then private int _prop; public int SomePropertyINeed {get {return _prop;} set {_prop = value;}} }   public class BList : IList { // ... THis was where i first stumbled as it was giving me an error that basically tells that "Cannot serialze a generic list object". have a peek here

Additionally you'd need to typecast the return value from the GetValue(...) call. Can Communism become a stable economic strategy? What's the most recent specific historical element that is common between Star Trek and the real world? that way you will know exactly which one is causing you the problem. http://stackoverflow.com/questions/24191054/how-to-serialize-a-viewstate-objects

However it does deserialize read-only collections fine, even if it can't do the instantiation itself. Ben Santiago, MCP Certified & A+ Certified Programmer Analyst (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet) 3/7/2012 3:12 PM Ben Santiago www.bensantiago.comJoined: 5/15/2006 Posts: 261 Re: Left by Kevin Davlin on Aug 01, 2012 1:39 PM # re: Problem storing a Generic list object in Viewstate i was looking for that more than an hour!! Saturday, May 17, 2008 7:09 PM Moderator 0 Sign in to vote I'm not asking the serializer to instantiate the interface, because collections should be instantiated by the owning class (which

In the code, you need to flag the class/object as “Serializable”. It's quick & easy. Note, it does work with non-generic IList with ASMX, just not the generic version. Not the answer you're looking for?

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed IList implementation, then private string _prop; public string SomePropertyINeed {get {return _prop;} set {_prop = value;}} }     An instance of the first class would serialize an int. The second would serialize a string.   When it's time to deserialize, how would a caller know which class had been serialized? http://stackoverflow.com/questions/7186591/error-saving-viewstate-in-entity-framework Jun 1 '07 #4 P: n/a ktrvnbq02 On Jun 1, 1:31 pm, "Jon Skeet [C# MVP]"

COMPANY About DNN DNN Blog Leadership Careers News Contact Us QUICK LINKS Free Trial Download Manuals Videos Community Community Blog [emailprotected] (650) 288.3150  (650) 288.3191 Follow Facebook DNN Corp Twitter Linked Try adding the parts of the class one-by-one to ViewState until you find the one that is wrong. VB.Net _ Public Class MyObject Public n1 As Integer = 0 Public n2 As Integer = 0 Public str As [String] = Nothing End Class C# [Serializable] public class MyObject Please review the stack trace for more information about the error and where it originated in the code.

Left by Celal Ak on Jun 06, 2009 10:55 PM # re: Problem storing a Generic list object in Viewstate Thanks buddy, I was stuck on the same kind of problem. https://social.msdn.microsoft.com/Forums/en-US/8cb7b9c0-03b3-4af9-9762-d7e2654f7c17/how-to-serialize-systemcollectionsgenericilist?forum=asmxandxml If so everything in your object hierarchy must be marked [Serializable] –Peter Monks Feb 2 '12 at 17:02 please post the code sample.. Looking for a book that discusses differential topology/geometry from a heavy algebra/ category theory point of view In the United States is racial, ethnic, or national preference an acceptable hiring practice Security Patch SUPEE-8788 - Possible Problems?

No Flaming or Trolling. navigate here How would they learn astronomy, those who don't see the stars? And I have serialize that entity as well. Any code that does that assumes that the only thing that matters about the IList is the fact that it's a list of something.

Your solution works great....thanks! Listhttp://vgadownload.com/error-serializing/cannot-serialize-interface-system-collections-generic-ilist.html UPDATE heap table -> Deadlocks on RID reduce() in Java8 Stream API What is the more appropriate way to create a hold-out set: to remove some subjects or to remove some

Normally, I would just use a System.Collections.Generic.List instead, but, what I'm trying to serialize is a domain object that I use with NHibernate. Dictionary 2. Subscribe to our monthly newsletter for tech news and trends Membership How it Works Gigs Live Careers Plans and Pricing For Business Become an Expert Resource Center About Us Who We

It also sets a ViewState variable that contains the results of the query.

See more: ASP.NET Hii , I am trying to mainatain list collections in viewste which is throwing an error I am applying sort order on my table and that sort order Go to Solution 5 Comments LVL 3 Overall: Level 3 ASP.NET 2 .NET Programming 1 Message Expert Comment by:JunkMan2008-10-16 what exactly is .getData() returning, one of the IEnumerable's returned is share|improve this answer answered Feb 2 '12 at 17:05 Steve Wellens 17.8k21546 Hmm, this is not feasbile as the source is huge!!! –user559142 Feb 2 '12 at 17:20 4 SerializationInfo is a sealed class. [Serializable()] private class ActivityData : ISerializable { public int ActivityID = 0; public List

more hot questions question feed lang-cs about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation I wanted to serialize a entity in the Viewstate myself and couldn't find a good solution (XMLSerialization, Byte Serializing, DataContract). All I want the serializer to do is to add items to the collection, not create the collection first, so why should the serializer care what about implementation details of the this contact form Let's work to help developers, not make them feel stupid.

I see what you mean now... Currently I store the TableRow in a Session and then rebuild the HtmlTable on the PostBack.How can you store the TableRow in a ViewState? I'm trying to store LINQ to SQL objects in viewstate. using System; namespace OAuthServerBroker.EF { [Serializable] public partial class ResourceOwner { public EntityState State { get; set; } //can even put into new properties } } Hope this might help anyone

Is it possible to have a planet unsuitable for agriculture? you can't use List, you have to use an IList because NHibernate will assign it's own IList implementation for you. [WebMethod] public System.Collections.IList NonGenericTest() { System.Collections.IList l = new System.Collections.ArrayList(); l.Add("string I'm receiving the following exception, Cannot serialize interface System.Collections.Generic.IList`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]. General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ

This includes promotion of commercial and non-commercial products or services which are not directly related to DNN. I found my answer. Is there an error placing the object in Viewstate? 6/1/2012 1:30 PM Ben Santiago www.bensantiago.comJoined: 5/15/2006 Posts: 261 Re: Error Serializing Value...? That's what the tags are for.

These Forums are dedicated to discussion of DNN Platform and Evoq Solutions. This is exactly what I needed! info.AddValue("IncumbentManager", IncumbentManager); info.AddValue("ClosingDate", ClosingDate); } } PS: Not all ActivityData objects will have a value for IncumbentManager. asked 2 years ago viewed 2977 times active 2 years ago Get the weekly newsletter!

I don't understand how taking something that is 'huge' and temporarily breaking it into smaller chunks could be a problem. Connect with top rated Experts 19 Experts available now in Live! Left by Adam on Nov 08, 2007 9:37 AM # re: Problem storing a Generic list object in Viewstate Your posting is really great Left by Chandrasekhar on Apr 12, 2009 asked 5 years ago viewed 1108 times active 1 year ago Linked 0 How do I serialize Entity Framework entities (EF 5.0)?

Solved Error on postback after adding ViewState Posted on 2008-10-16 .NET Programming ASP.NET 1 Verified Solution 5 Comments 4,152 Views Last Modified: 2013-12-17 After adding the line ViewState["CachedControls"] = data to But when I try to save data to viewstate, getting this error: Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Error serializing value 'System.Collections.Generic.List`1[Pc.PrecisionCare2.ModelTypes.Medication]' of type 'System.Collections.Generic.List`1[[Pc.PrecisionCare2.ModelTypes.Medication, PrecisionCare2ModelTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].' c# .net asp.net Each of them would serialize differently from the others.