Why doesn’t my Collection Properties get saved in the aspx file properly during design-time?

Platform: ASP.NET| Category: Serialization

Some common mistakes that will cause the designer to choke while persisting collection properties are:

  • The corresponding collection type cannot have multiple (overloaded) indexers. You should always define a single indexer of the type ‘public SomeType this[object obj]{…}‘. Otherwise the changes will be persisted but the control will not load in the designer. You will see a ‘Ambiguous match found’ error.
  • If the collection property has the PersistenceMode attribute set to InnerProperty then the property should not include a set method.
  • Share with